fix: error from coreutils would kill the cmd

This commit is contained in:
minjaesong
2024-08-11 21:18:25 +09:00
parent 456426cafe
commit 0b4ba339c6

View File

@@ -684,8 +684,13 @@ shell.execute = function(line) {
}
if (shell.coreutils[cmd.toLowerCase()] !== undefined) {
var retval = shell.coreutils[cmd.toLowerCase()](tokens)
retValue = retval|0 // return value of undefined will cast into 0
try {
var retval = shell.coreutils[cmd.toLowerCase()](tokens)
retValue = retval|0 // return value of undefined will cast into 0
}
catch {
if (!retValue) retValue = 1
}
continue
}
else {