added handling invalid invoke functions and ported a couple of apps

stopped component.invoke from throwing a cryptic error, and ported over cat, cd, clear, cp, edit, ls, lsdrv, and mkdir
This commit is contained in:
Ponali
2025-09-14 17:45:36 +02:00
parent 8244f1590c
commit 3c087aaddf
9 changed files with 49 additions and 33 deletions
+3 -2
View File
@@ -1,14 +1,15 @@
local directory = ...
local fs = require("filesystem")
local shell = require("shell")
if not directory then
return
end
if directory:sub(1, 1) ~= "/" then
directory = fs.concat(shell.workingDirectory, directory)
directory = fs.concat(shell.getWorkingDirectory(), directory)
end
if fs.exists(directory) and fs.isDirectory(directory) then
shell.workingDirectory = fs.canonical(directory)
shell.setWorkingDirectory(fs.canonical(directory))
else
print("\27[91mNo such directory.")
end