ported apps download/wget, fetch, label, and lscor/ps

for the fetch app to fully work, defenv has been edited to share _OSLOGO.
This commit is contained in:
Ponali
2025-09-14 18:46:26 +02:00
parent 3c087aaddf
commit ff04e730f9
5 changed files with 18 additions and 15 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ end
if not url then if not url then
print("Please enter a URL to download from.") print("Please enter a URL to download from.")
shell.run("help download") require("shell").run("help download")
return return
end end
@@ -39,7 +39,7 @@ until not tmpdata
local saveLocation local saveLocation
local saveLocationOK = false local saveLocationOK = false
repeat repeat
saveLocation = read(nil, "File save location: ", fs.concat(shell.workingDirectory, url:match("/([^/]+)$"))) saveLocation = terminal.read(nil, "File save location: ", fs.concat(require("shell").getWorkingDirectory(), url:match("/([^/]+)$")))
if fs.isDirectory(saveLocation) then if fs.isDirectory(saveLocation) then
print("\27[91mThe specified location is a directory.") print("\27[91mThe specified location is a directory.")
elseif fs.exists(saveLocation) then elseif fs.exists(saveLocation) then
+6 -3
View File
@@ -2,12 +2,14 @@ local component = require("component")
local computer = require("computer") local computer = require("computer")
local function printstat(text) local function printstat(text)
terminal.cursorPosX = 35 local cursorPosX, cursorPosY = terminal.getCursorPos()
terminal.setCursorPos(35, cursorPosY)
terminal.write(text .. "\n", false) terminal.write(text .. "\n", false)
end end
terminal.write(_OSLOGO, false) terminal.write(_OSLOGO, false)
terminal.cursorPosY = terminal.cursorPosY - 17 local cursorPosX, cursorPosY = terminal.getCursorPos()
terminal.setCursorPos(cursorPosX, cursorPosY - 17)
printstat("\27[92mOS\27[0m: ".._OSVERSION) printstat("\27[92mOS\27[0m: ".._OSVERSION)
printstat("\27[92mArchitecture\27[0m: ".._VERSION) printstat("\27[92mArchitecture\27[0m: ".._VERSION)
local componentCounter = 0 local componentCounter = 0
@@ -67,4 +69,5 @@ local width, height = component.invoke(component.list("gpu")(), "getResolution")
printstat("\27[92mResolution\27[0m: "..tostring(width).."x"..tostring(height).."\n") printstat("\27[92mResolution\27[0m: "..tostring(width).."x"..tostring(height).."\n")
printstat("\27[40m \27[41m \27[42m \27[43m \27[44m \27[45m \27[46m \27[47m ") printstat("\27[40m \27[41m \27[42m \27[43m \27[44m \27[45m \27[46m \27[47m ")
printstat("\27[100m \27[101m \27[102m \27[103m \27[104m \27[105m \27[106m \27[107m ") printstat("\27[100m \27[101m \27[102m \27[103m \27[104m \27[105m \27[106m \27[107m ")
terminal.cursorPosY = terminal.cursorPosY + 5 local cursorPosX, cursorPosY = terminal.getCursorPos()
terminal.setCursorPos(cursorPosX, cursorPosY + 5)
+2 -2
View File
@@ -3,7 +3,7 @@ local computer = require("computer")
local args = {...} local args = {...}
if not args then return print("\x1b[91mCannot get arguments.") end if not args then return print("\x1b[91mCannot get arguments.") end
if not args[1] then if not args[1] then
return shell.run("help label") return require("shell").run("help label")
end end
local inputID = args[1] local inputID = args[1]
local comp local comp
@@ -33,7 +33,7 @@ elseif #inputID>=3 then
comp = component.proxy(fullID) comp = component.proxy(fullID)
else else
print("\x1b[91mAddress must have atleast 3 characters") print("\x1b[91mAddress must have atleast 3 characters")
return shell.run("help label") return require("shell").run("help label")
end end
if not comp then if not comp then
return print("\x1b[91mCould not find component from \""..inputID.."\".") return print("\x1b[91mCould not find component from \""..inputID.."\".")
+7 -8
View File
@@ -1,9 +1,8 @@
print("\27[93m"..tostring(#cormgr.corList).."\27[0m coroutines active") local tasks = tsched.getTasks()
for i=1, #cormgr.corList do print("\27[93m"..tostring(#tasks).."\27[0m coroutines active")
if i==#cormgr.corList then for i=1, #tasks do
print("\27[93m└ "..i.."\27[0m - "..cormgr.labelList[i].." \27[0m") local pipeChar = ""
else if i==#tasks then pipeChar = "" end
print("\27[93m├ "..i.."\27[0m - "..cormgr.labelList[i].." \27[0m") local task = tasks[i]
end print("\27[93m"..pipeChar..i.."\27[0m - "..task.name.."\27[37m "..table.concat(task.args or {}," ").." \27[0m")
end end
+1
View File
@@ -11,6 +11,7 @@ function module.init()
"print", "print",
"_VERSION", "_VERSION",
"_OSVERSION", "_OSVERSION",
"_OSLOGO",
"assert", "assert",
"error", "error",
"getmetatable", "getmetatable",