further shell updates
This commit is contained in:
+16
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user