This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
FREAX/bin/convert

23 lines
882 B
Text
Raw Normal View History

2022-07-18 19:33:40 +02:00
local args = {...}
local function checksys(txt)
if txt == "kernel" or txt == "gui" or txt == "app" or txt == "log" or txt == "config" or txt == "manual" or txt == "search" or txt == "tpm" or txt == "exception" or string.find(txt, "boot/") or string.find(txt, "system/") or string.find(txt, ".freax/startup") then
kerneldraw.printAppWarning("kernel", "attempt to perform restricted operations")
--return true
end
end
if #args < 1 or not fs.exists(shell.resolveProgram(args[1])) or fs.isDir(shell.resolve(args[1])) then
kerneldraw.printAppInfo("config", "No file specified")
return
end
if not checksys(shell.resolveProgram(args[1])) then
if os.loadAPI(shell.resolveProgram(args[1])) then
config.save(_G[args[1]], textutils.serialize(args[1]))
os.unloadAPI(args[1])
kerneldraw.printAppSuccess("config", "Done")
end
else
exception.throw("RestrictedOpsException")
end