Files
cc-Lua-bs/git/updater/updater.lua

27 lines
786 B
Lua

shell.run("ls /git/")
print("What project would you like to update?")
local projectName = io.read()
local URL, projectFile
if fs.exists("/git/"..projectName.."/project.file") then
local file = fs.open("/git/"..projectName.."/project.file", "r")
projectFile = load("return {"..(file.readAll() or "").."}")()
file.close()
print(textutils.serialise(projectFile))
URL = projectFile.url
else
print("please enter git url or make a project file")
URL = io.read()
end
fs.delete("/git/"..projectName.."/*")
--shell.run("cd /git/"..projectName)
local i = 1
local list = projectFile.files
while i < #list do
shell.run("wget "..URL.."/git/ "..projectName.."/"..list[i])
i = i + 1
end
--shell.run("wget "..URL.."/git/ "..projectName.."/")
shell.run("cd /")