ported apps lscor, mv, and rm
there's partially rtest too, if you count that
This commit is contained in:
@@ -4,5 +4,5 @@ for i=1, #tasks do
|
|||||||
local pipeChar = "├ "
|
local pipeChar = "├ "
|
||||||
if i==#tasks then pipeChar = "└ " end
|
if i==#tasks then pipeChar = "└ " end
|
||||||
local task = tasks[i]
|
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
|
end
|
||||||
|
|||||||
+3
-2
@@ -1,4 +1,5 @@
|
|||||||
local fromFile, toFile = ...
|
local fromFile, toFile = ...
|
||||||
|
local shell = require("shell")
|
||||||
local fs = require("filesystem")
|
local fs = require("filesystem")
|
||||||
|
|
||||||
if not fromFile or not toFile then
|
if not fromFile or not toFile then
|
||||||
@@ -6,10 +7,10 @@ if not fromFile or not toFile then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if fromFile:sub(1, 1) ~= "/" then
|
if fromFile:sub(1, 1) ~= "/" then
|
||||||
fromFile = fs.concat(shell.workingDirectory, fromFile)
|
fromFile = fs.concat(shell.getWorkingDirectory(), fromFile)
|
||||||
end
|
end
|
||||||
if toFile:sub(1, 1) ~= "/" then
|
if toFile:sub(1, 1) ~= "/" then
|
||||||
toFile = fs.concat(shell.workingDirectory, toFile)
|
toFile = fs.concat(shell.getWorkingDirectory(), toFile)
|
||||||
end
|
end
|
||||||
if fromFile == toFile then
|
if fromFile == toFile then
|
||||||
print("\27[91mSource and destination are the same.")
|
print("\27[91mSource and destination are the same.")
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
local file = ...
|
local file = ...
|
||||||
|
local shell = require("shell")
|
||||||
local fs = require("filesystem")
|
local fs = require("filesystem")
|
||||||
|
|
||||||
if not file then
|
if not file then
|
||||||
@@ -6,7 +7,7 @@ if not file then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
if file:sub(1, 1) ~= "/" then
|
if file:sub(1, 1) ~= "/" then
|
||||||
file = fs.concat(shell.workingDirectory, file)
|
file = fs.concat(shell.getWorkingDirectory(), file)
|
||||||
end
|
end
|
||||||
if not fs.exists(file) then
|
if not fs.exists(file) then
|
||||||
print("\27[91mFile does not exist.")
|
print("\27[91mFile does not exist.")
|
||||||
|
|||||||
@@ -88,4 +88,4 @@ end
|
|||||||
end ]]
|
end ]]
|
||||||
|
|
||||||
raster.free()
|
raster.free()
|
||||||
termlib.cursorPosY=1
|
terminal.setCursorPos(1,1)
|
||||||
|
|||||||
Reference in New Issue
Block a user