mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Merge pull request #2109 from payonel/cleanup-program-locations
wget and pastebin are now core to openos install
This commit is contained in:
commit
dd10cd7ecc
@ -52,7 +52,8 @@ function process.load(path, env, init, name)
|
|||||||
io.stderr:write(path .. ": is a directory\n")
|
io.stderr:write(path .. ": is a directory\n")
|
||||||
return 126
|
return 126
|
||||||
end
|
end
|
||||||
io.stderr:write(path .. ": " .. reason .. "\n")
|
local handler = require("tools/programLocations")
|
||||||
|
handler.reportNotFound(path, reason)
|
||||||
return 127
|
return 127
|
||||||
end
|
end
|
||||||
os.setenv("_", program)
|
os.setenv("_", program)
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
local computer = require("computer")
|
||||||
|
local lib = {}
|
||||||
|
|
||||||
|
function lib.locate(path)
|
||||||
|
for _,lookup in ipairs(computer.getProgramLocations()) do
|
||||||
|
if lookup[1] == path then
|
||||||
|
return lookup[2]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function lib.reportNotFound(path, reason)
|
||||||
|
checkArg(1, path, "string")
|
||||||
|
local loot = lib.locate(path)
|
||||||
|
if loot then
|
||||||
|
io.stderr:write("The program '" .. path .. "' is currently not installed. To install it:\n" ..
|
||||||
|
"1. Craft the '" .. loot .. "' floppy disk and insert it into this computer.\n" ..
|
||||||
|
"2. Run `install " .. loot .. "`")
|
||||||
|
elseif type(reason) == "string" then
|
||||||
|
io.stderr:write(path .. ": " .. reason .. "\n")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return lib
|
@ -80,8 +80,6 @@ object ModOpenComputers extends ModProxy {
|
|||||||
api.IMC.registerProgramDiskLabel("md5sum", "data", "Lua 5.2", "Lua 5.3", "LuaJ")
|
api.IMC.registerProgramDiskLabel("md5sum", "data", "Lua 5.2", "Lua 5.3", "LuaJ")
|
||||||
api.IMC.registerProgramDiskLabel("sha256sum", "data", "Lua 5.2", "Lua 5.3", "LuaJ")
|
api.IMC.registerProgramDiskLabel("sha256sum", "data", "Lua 5.2", "Lua 5.3", "LuaJ")
|
||||||
api.IMC.registerProgramDiskLabel("refuel", "generator", "Lua 5.2", "Lua 5.3", "LuaJ")
|
api.IMC.registerProgramDiskLabel("refuel", "generator", "Lua 5.2", "Lua 5.3", "LuaJ")
|
||||||
api.IMC.registerProgramDiskLabel("pastebin", "internet", "Lua 5.2", "Lua 5.3", "LuaJ")
|
|
||||||
api.IMC.registerProgramDiskLabel("wget", "internet", "Lua 5.2", "Lua 5.3", "LuaJ")
|
|
||||||
api.IMC.registerProgramDiskLabel("irc", "irc", "Lua 5.2", "Lua 5.3", "LuaJ")
|
api.IMC.registerProgramDiskLabel("irc", "irc", "Lua 5.2", "Lua 5.3", "LuaJ")
|
||||||
api.IMC.registerProgramDiskLabel("maze", "maze", "Lua 5.2", "Lua 5.3", "LuaJ")
|
api.IMC.registerProgramDiskLabel("maze", "maze", "Lua 5.2", "Lua 5.3", "LuaJ")
|
||||||
api.IMC.registerProgramDiskLabel("arp", "network", "Lua 5.2", "Lua 5.3", "LuaJ")
|
api.IMC.registerProgramDiskLabel("arp", "network", "Lua 5.2", "Lua 5.3", "LuaJ")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user