This commit is contained in:
Raven Scott
2026-04-02 22:35:09 -04:00
parent efeee0088a
commit 2e26b14250
56 changed files with 1838 additions and 75 deletions
+19 -3
View File
@@ -1,4 +1,20 @@
// Drive path: /bin/echo — print arguments (kernel invokes run(argv))
async function run(ctx, argv) {
ctx.console.log(argv.slice(1).join(' '))
/** 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 parts = argv.slice(1)
let n = false
if (parts[0] === '-n') {
n = true
parts.shift()
}
const s = parts.join(' ')
const w = globalThis.process?.stdout?.write
if (typeof w === 'function') {
w.call(globalThis.process.stdout, s + (n ? '' : '\n'))
} else {
ctx.console.log(n ? s : s)
}
}