Files
bare-operating-system/packages/bare-os-seeder/kernel/bin/sleep
T
2026-04-02 22:43:46 -04:00

15 lines
439 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 sec = parseFloat(argv[1] || '0')
if (Number.isNaN(sec) || sec < 0) {
ctx.console.error('sleep: invalid time interval')
ctx.exitCode = 1
return
}
await new Promise((r) => setTimeout(r, sec * 1000))
}