Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local libbb = ld.dlopen("/lib/libbitbucket.lua")
- local function mkdirs(user, repo, branch, path)
- local ret = libbb.get_dirs(user, repo, branch, path);
- local files = {}
- for k, v in pairs(ret) do
- if not syscall.exists(v) then
- syscall.mkdir(v);
- end
- files = libbb.get_files(user,repo,branch,path)
- for x,y in pairs(files) do
- if not syscall.exists(path.."/"..y) and y ~= "" then
- local file = fs.open(path.."/"..y,"w")
- local contents = libbb.read_file(user,repo,branch,path.."/"..y)
- file.write(contents)
- file.flush()
- file.close()
- end
- end
- if ret[1] == "" then
- return
- end
- mkdirs(user, repo, branch, path.."/"..v);
- end
- end
- local function install(user,repo,branch,path)
- mkdirs(user,repo,branch,path)
- end
- install("scoopta","scaptos2-repo","default","brainfuck")
Advertisement
Add Comment
Please, Sign In to add comment