Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- git = {}
- sArgs = ...
- Branch = "patch2"
- if sArgs then
- Branch = sArgs
- end
- function createFile(filename,string)
- local h = fs.open(filename,"w")
- h.write(string)
- h.close()
- end
- function git.get(address,filename)
- write("Connecting to github.com... ")
- local response = http.get(address)
- if response then
- print("")
- print( "Downloaded as "..filename )
- else
- print("")
- error("No response recieved : "..address)
- end
- createFile(filename,response.readAll())
- end
- function git.run(address,...)
- sCode = http.get(address).readAll()
- if sCode then
- local func, err = loadstring(sCode)
- if not func then
- printError( err )
- return
- end
- setfenv(func, getfenv())
- local success, msg = pcall(func, unpack(...))
- if not success then
- printError( msg )
- end
- end
- end
- --git.run("https://raw.githubusercontent.com/GuitarMusashi616/SchematicTurtle/Swarm/setup.lua",{"update"})
- --print("Branch = "..Branch)
- git.get("https://raw.githubusercontent.com/GuitarMusashi616/SchematicTurtle/"..Branch.."/setup.lua","setup")
- --git.run(goAddress,{"rt","4","fd","2})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement