From 0b4ba339c6efd21feac42688f1a7d19c1876d9f1 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Sun, 11 Aug 2024 21:18:25 +0900 Subject: [PATCH] fix: error from coreutils would kill the cmd --- assets/disk0/tvdos/bin/command.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/assets/disk0/tvdos/bin/command.js b/assets/disk0/tvdos/bin/command.js index 98a07ee..659c38e 100644 --- a/assets/disk0/tvdos/bin/command.js +++ b/assets/disk0/tvdos/bin/command.js @@ -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 {