Upload files to "git/updater"
This commit is contained in:
26
git/updater/updater.lua
Normal file
26
git/updater/updater.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
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 /")
|
||||
Reference in New Issue
Block a user