From bbb49caf951f3232b3fc5bc06ae71fac2c8ab4f1 Mon Sep 17 00:00:00 2001 From: Dominic Zimmer Date: Sat, 4 Jul 2020 14:44:10 +0200 Subject: [PATCH] Add gitea update --- gitea.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gitea.lua b/gitea.lua index 443f164..f598929 100644 --- a/gitea.lua +++ b/gitea.lua @@ -17,4 +17,13 @@ if args[1] == "get" then handle:write(response.readAll()) handle:close() response.close() +if args[2] == "update" then + url = "https://gitea.leafbla.de/dominic/turtles/raw/branch/master/"..filename..".lua" + response = http.get(url) + os.remove(args[3]) + local handle = io.open(args[3], "w") + handle:write(response.readAll()) + handle:close() + response.close() +end end