Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet = require("internet")
- local fs = require("filesystem")
- local shell = require("shell")
- local ser = require("serialization")
- local host = "alexcatze.pythonanywhere.com"
- local owner = "AlexCatze"
- local repo = "RacoonNet"
- local ref = "v0.3"
- local path = "/"
- local deploy_to = "/"
- function request(url)
- local data = ""
- local result, response = pcall(internet.request, url)
- if result then
- local result = pcall(function()
- for chunk in response do
- data = data .. chunk
- end
- end)
- end
- return data
- end
- files = ser.unserialize(request("http://"..host.."/?owner="..owner.."&repo="..repo.."&path="..path.."&ref="..ref))
- for _,v in pairs(files) do
- local pth = deploy_to..v
- if not fs.exists(pth:match(".*/")) then fs.makeDirectory(pth:match(".*/")) end
- shell.execute("wget -f ".."https://raw.githubusercontent.com/"..owner.."/"..repo.."/"..ref.."/"..v.." "..pth)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement