Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- command = args[1]
- args[2] = args[2] or "san-get"
- programs = {}
- programs["san-bb"] = "cc/san-bb.lua"
- programs["san-get"] = "cc/san-get.lua"
- if not(fs.exists("san-bb")) then
- print("Initial install...")
- shell.run("pastebin","get gK3LCMmC san-bb")
- end
- function exec(cmd,params)
- shell.run(cmd,params)
- end
- function update(program,url)
- print("Removing old version of "..program)
- exec("rm",program)
- install(program,url)
- end
- function install(program,url)
- print("Installing "..program)
- exec("san-bb","get "..url.." "..program)
- end
- if command=="update" then
- if programs[args[2]] ~= nil then
- update(args[2],programs[args[2]])
- else
- error("Program "..args[2].." not found in repo")
- end
- elseif command=="install" then
- if programs[args[2]] ~= nil then
- if fs.exists(args[2]) then
- update(args[2],programs[args[2]])
- else
- install(args[2],programs[args[2]])
- end
- else
- error("Program "..args[2].." not found in repo")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement