Deleting a file without ext print a normal error msg.

This commit is contained in:
Olivier Gagnon
2021-05-17 18:09:47 -04:00
parent b9c292f7cf
commit afc1347d3a
3 changed files with 12 additions and 2 deletions
+10 -2
View File
@@ -1313,9 +1313,17 @@ let Terminal = {
}
// Check programs
let delTarget = Terminal.getFilepath(commandArray[1]);
let delTarget, status;
try {
delTarget = Terminal.getFilepath(commandArray[1]);
status = s.removeFile(delTarget);
} catch(err) {
status = {
res: false,
msg: 'No such file exists'
};
}
const status = s.removeFile(delTarget);
if (!status.res) {
postError(status.msg);
}