updates
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/** 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 e = ctx.vfs.env
|
||||
const names = argv.slice(1).filter((a) => !a.startsWith('-'))
|
||||
if (!names.length) {
|
||||
for (const k of Object.keys(e).sort()) {
|
||||
ctx.console.log(k + '=' + (e[k] ?? ''))
|
||||
}
|
||||
return
|
||||
}
|
||||
for (const n of names) {
|
||||
if (e[n] != null) ctx.console.log(e[n])
|
||||
else ctx.exitCode = 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user