Jabulba

update quarry

Dec 14th, 2020 (edited)
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. function cleanup(file)
  2.     if fs.exists(file) then
  3.         print("Deleting " .. file)
  4.         shell.run("delete", file)
  5.     end
  6. end
  7.  
  8. function download(programName, fileName, url)
  9.     local fileStream = http.get(url)
  10.     local fileData = fileStream.readAll()
  11.     fileStream.close()
  12.  
  13.     local file = fs.open(fileName, "w")
  14.     file.write(fileData)
  15.     file.close()
  16.  
  17.     print(programName .. " program updated!")
  18. end
  19.  
  20. cleanup("install.lua")
  21. download("Installer", "install.lua", "https://raw.githubusercontent.com/Jabulba/Turtle-LCars-OS/master/install.lua")
  22.  
  23. shell.run("install.lua")
Add Comment
Please, Sign In to add comment