Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function skeleton(path)
- local tmp_path=""
- for comp in string.gmatch(path,"(.-)/") do
- tmp_path=tmp_path.."/"..comp
- if not fs.exists(tmp_path) then fs.makeDir(tmp_path) end
- end
- end
- local args={...}
- local path=args[1]
- local repo="Stary2001/StaryOS"
- skeleton(path)
- local page=http.get("https://api.bitbucket.org/1.0/repositories/"..repo.."/raw/master/"..path)
- local s = page.readAll()
- page.close()
- local f = fs.open(path,"w")
- if f then
- f.write(s)
- f.close()
- else print(path .. " failed for writing!") end
Advertisement
Add Comment
Please, Sign In to add comment