18 lines
472 B
Plaintext
18 lines
472 B
Plaintext
/** Shared helpers for drive-resident /bin scripts (prepended before each command). */
|
|
function bareStdin(ctx) {
|
|
return typeof ctx.shellStdin === 'string' ? ctx.shellStdin : ''
|
|
}
|
|
|
|
async function run(ctx, argv) {
|
|
const save = ctx.saveVault
|
|
if (typeof save !== 'function') {
|
|
ctx.console.error('savevault: not supported in this environment')
|
|
return
|
|
}
|
|
try {
|
|
await save.call(ctx)
|
|
} catch (err) {
|
|
ctx.console.error(err?.message ?? String(err))
|
|
}
|
|
}
|