Advertisement
Guest User

Installer_RacoonWeb

a guest
Mar 14th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. local internet = require("internet")
  2. local fs = require("filesystem")
  3. local shell = require("shell")
  4. local ser = require("serialization")
  5.  
  6. local host = "alexcatze.pythonanywhere.com"
  7. local owner = "AlexCatze"
  8. local repo = "RacoonNet"
  9. local ref = "v0.3"
  10. local path = "/"
  11. local deploy_to = "/"
  12.  
  13. function request(url)
  14.   local data = ""
  15.   local result, response = pcall(internet.request, url)
  16.   if result then
  17.     local result = pcall(function()
  18.       for chunk in response do
  19.         data = data .. chunk
  20.       end
  21.     end)
  22.   end
  23.   return data  
  24. end
  25.  
  26. files = ser.unserialize(request("http://"..host.."/?owner="..owner.."&repo="..repo.."&path="..path.."&ref="..ref))
  27.  
  28. for _,v in pairs(files) do
  29.   local pth = deploy_to..v
  30.   if not fs.exists(pth:match(".*/")) then fs.makeDirectory(pth:match(".*/")) end
  31.   shell.execute("wget -f ".."https://raw.githubusercontent.com/"..owner.."/"..repo.."/"..ref.."/"..v.." "..pth)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement