further shell updates

This commit is contained in:
Raven Scott
2026-04-26 16:24:57 -04:00
parent d3001aba9c
commit a553a4e4a7
16 changed files with 300 additions and 44246 deletions
+16 -1
View File
@@ -215,5 +215,20 @@ async function evalTest(ctx, args) {
}
async function run(ctx, argv) {
ctx.exitCode = (await evalTest(ctx, argv.slice(1))) ? 0 : 1
const prog0 = argv[0] != null ? String(argv[0]) : ''
let testArgs = argv.slice(1)
if (prog0 === '[' || prog0.endsWith('/[')) {
if (!testArgs.length) {
ctx.console.error('[: missing ]')
ctx.exitCode = 2
return
}
if (testArgs[testArgs.length - 1] !== ']') {
ctx.console.error('[: expected ]')
ctx.exitCode = 2
return
}
testArgs = testArgs.slice(0, -1)
}
ctx.exitCode = (await evalTest(ctx, testArgs)) ? 0 : 1
}