updates
CI / test (push) Failing after 4m57s

This commit is contained in:
Raven Scott
2026-04-02 22:43:46 -04:00
parent 2e26b14250
commit c337a8aaa6
62 changed files with 1099 additions and 23 deletions
+31
View File
@@ -0,0 +1,31 @@
/** 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 args = argv.slice(1).filter((a) => !a.startsWith('-'))
let a = 1
let step = 1
let b = 1
if (args.length === 1) {
b = parseInt(args[0], 10)
} else if (args.length === 2) {
a = parseInt(args[0], 10)
b = parseInt(args[1], 10)
} else if (args.length >= 3) {
a = parseInt(args[0], 10)
step = parseInt(args[1], 10)
b = parseInt(args[2], 10)
}
if (step === 0 || Number.isNaN(a) || Number.isNaN(b) || Number.isNaN(step)) {
ctx.console.error('seq: invalid arguments')
ctx.exitCode = 1
return
}
if (step > 0) {
for (let x = a; x <= b; x += step) ctx.console.log(String(x))
} else {
for (let x = a; x >= b; x += step) ctx.console.log(String(x))
}
}