From 819a33adfb6b3b0455bddcdf0f1f1a7ab7ceb5e7 Mon Sep 17 00:00:00 2001 From: minecartchris Date: Sun, 9 Nov 2025 17:47:15 -0500 Subject: [PATCH] Upload files to "git/updater" --- git/updater/updater.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 git/updater/updater.lua diff --git a/git/updater/updater.lua b/git/updater/updater.lua new file mode 100644 index 0000000..c44aa0d --- /dev/null +++ b/git/updater/updater.lua @@ -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 /")