From 3150525ee2024fc605669093b89f75f0c741a81f Mon Sep 17 00:00:00 2001 From: Kan18 <24967425+Kan18@users.noreply.github.com> Date: Mon, 4 Jul 2022 00:08:59 -0400 Subject: [PATCH] Fix #48 (shell resolving issue) (#58) --- sys/apps/shell.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/apps/shell.lua b/sys/apps/shell.lua index a08e0b0..1eecbfa 100644 --- a/sys/apps/shell.lua +++ b/sys/apps/shell.lua @@ -173,15 +173,12 @@ function shell.resolveProgram(_sCommand) end end - if not _sCommand:find('/') then - return inPath() - end - -- so... even if you are in the rom directory and you run: -- 'packages/common/edit.lua', allow this even though it -- does not use a leading slash. Ideally, fs.combine would -- provide the leading slash... but it does not. - return check(shell.resolve(_sCommand)) + return (not _sCommand:find('/')) and inPath() + or check(shell.resolve(_sCommand)) or check(shell.resolve(_sCommand) .. '.lua') or check(_sCommand) or check(_sCommand .. '.lua')