pluggeman

installer

Apr 16th, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. programs = {
  2.     Gui = {
  3.         link = 'f6djY9FP',
  4.         path = '/core/'
  5.     },
  6.     Main = {
  7.         link = 'RKBCni9R',
  8.         path = '/'
  9.     }
  10. }
  11.  
  12. function printInfo(...)
  13.     term.setTextColor(colors.green)
  14.     print(...)
  15.     term.setTextColor(colors.white)
  16. end
  17.  
  18. function deleteIfExists(path)
  19.     print(path)
  20.     if fs.exists(path) then shell.run("rm", path) end
  21. end
  22.  
  23. --delete programs
  24. printInfo("Delete existing programs...")
  25. for k, v in pairs(programs) do
  26.     deleteIfExists(v.path .. k)
  27. end
  28.  
  29. --download programs
  30. printInfo("Download new programs...")
  31. for k, v in pairs(programs) do
  32.     shell.run('pastebin', 'get', v.link, v.path .. k)
  33. end
  34.  
  35. printInfo("Ready!")
Add Comment
Please, Sign In to add comment