@@ -0,0 +1,17 @@
|
||||
/** Shared helpers for drive-resident /bin scripts (prepended before each command). */
|
||||
function bareStdin(ctx) {
|
||||
return typeof ctx.shellStdin === 'string' ? ctx.shellStdin : ''
|
||||
}
|
||||
|
||||
/** Drive-resident exit: ends the booter session (ctx.requestBooterExit from bare-os-booter). */
|
||||
async function run(ctx, argv) {
|
||||
let ec = 0
|
||||
if (argv[1] !== undefined) {
|
||||
const n = Number.parseInt(argv[1], 10)
|
||||
ec = Number.isFinite(n) ? n : 0
|
||||
}
|
||||
if (typeof ctx.requestBooterExit === 'function') {
|
||||
ctx.requestBooterExit(ec)
|
||||
}
|
||||
ctx.exitCode = ec
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@ function bareStdin(ctx) {
|
||||
|
||||
async function run(ctx, argv) {
|
||||
ctx.console.log(
|
||||
'Bare OS — builtins: cd, export, exit, quit | /bin: basename cat clear date dirname echo env false head help hostname id ls nl pathchk printenv pwd rm seq sleep sort tail test touch true tty uname wc which whoami'
|
||||
'Bare OS — builtins: cd, export, exit | /bin: basename cat clear date dirname echo env exit false head help hostname id ls nl pathchk printenv pwd rm seq sleep sort tail test touch true tty uname wc which whoami'
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user