Add gitea update

This commit is contained in:
Dominic Zimmer 2020-07-04 14:44:10 +02:00
parent 230504ea7e
commit bbb49caf95

View File

@ -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