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,4 +1,5 @@
local files = {...}
local shell = require("shell")
local fs = require("filesystem")
if not files or not files[1] then
shell.run("help cat")
@@ -6,7 +7,7 @@ if not files or not files[1] then
end
for _, file in ipairs(files) do
if file:sub(1, 1) ~= "/" then
file = fs.concat(shell.workingDirectory, file)
file = fs.concat(shell.getWorkingDirectory(), file)
end
if not fs.exists(file) then
print("\27[91mFile does not exist.")
@@ -15,6 +16,6 @@ for _, file in ipairs(files) do
local data
repeat
data = handle:read(math.huge or math.maxinteger)
termlib.write(data)
terminal.write(data)
until not data
end