ported apps lscor, mv, and rm

there's partially rtest too, if you count that
This commit is contained in:
Ponali
2025-09-15 07:08:19 +02:00
parent ff04e730f9
commit 66783e455c
4 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -4,5 +4,5 @@ for i=1, #tasks do
local pipeChar = ""
if i==#tasks then pipeChar = "" end
local task = tasks[i]
print("\27[93m"..pipeChar..i.."\27[0m - "..task.name.."\27[37m "..table.concat(task.args or {}," ").." \27[0m")
print("\27[93m"..pipeChar..(task.id or i).."\27[0m - "..task.name.."\27[37m "..table.concat(task.args or {}," ").." \27[0m")
end
+3 -2
View File
@@ -1,4 +1,5 @@
local fromFile, toFile = ...
local shell = require("shell")
local fs = require("filesystem")
if not fromFile or not toFile then
@@ -6,10 +7,10 @@ if not fromFile or not toFile then
return
end
if fromFile:sub(1, 1) ~= "/" then
fromFile = fs.concat(shell.workingDirectory, fromFile)
fromFile = fs.concat(shell.getWorkingDirectory(), fromFile)
end
if toFile:sub(1, 1) ~= "/" then
toFile = fs.concat(shell.workingDirectory, toFile)
toFile = fs.concat(shell.getWorkingDirectory(), toFile)
end
if fromFile == toFile then
print("\27[91mSource and destination are the same.")
+2 -1
View File
@@ -1,4 +1,5 @@
local file = ...
local shell = require("shell")
local fs = require("filesystem")
if not file then
@@ -6,7 +7,7 @@ if not file then
return
end
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.")
+1 -1
View File
@@ -88,4 +88,4 @@ end
end ]]
raster.free()
termlib.cursorPosY=1
terminal.setCursorPos(1,1)