sollaires

bootstrap.lua

Feb 2nd, 2013
979
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. --[[
  2.  
  3. turtle bootstrap
  4.  
  5. simple program to get a bunch of other programs in one run
  6. of 'pastebin get'
  7.  
  8. Usage:
  9.  
  10.   > pastebin get 55tqszpw bootstrap
  11.   > bootstrap
  12.  
  13. --]]
  14.  
  15. http_runs = {
  16.   ["pastebin"] = {
  17.     -- github loader
  18.     ["caMmH484"] = "github",
  19.   },
  20.   -- make sure to use the right URL for raw.github.com
  21.   ["github"] = {
  22.  
  23.     -- grab the github bootstrap
  24.     ["seriallos/computercraft/master/boot2.lua"] = "boot2",
  25.   },
  26. }
  27.  
  28. for service, list in pairs( http_runs ) do
  29.   for id, program in pairs( list ) do
  30.     print( "Downloading "..program.." from "..service )
  31.     shell.run( service, "get", id, program )
  32.   end
  33. end
  34.  
  35. -- run the bootstrapper from github
  36. -- second level of bootstrap is so the files on pastebin can be pretty static.
  37. -- github is way easier to manage from the command line.  i don't want to
  38. -- constantly be futzing with the pastebin site or API.
  39. -- git add .; git commit -m "blah"; git push  # so much better!
  40. shell.run( "boot2" )
Advertisement
Add Comment
Please, Sign In to add comment