Sirshark10

Untitled

Jun 24th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. local libbb = ld.dlopen("/lib/libbitbucket.lua")
  2.  
  3.  
  4. local function mkdirs(user, repo, branch, path)
  5. local ret = libbb.get_dirs(user, repo, branch, path);
  6. local files = {}
  7. for k, v in pairs(ret) do
  8. if not syscall.exists(v) then
  9. syscall.mkdir(v);
  10. end
  11. files = libbb.get_files(user,repo,branch,path)
  12. for x,y in pairs(files) do
  13. if not syscall.exists(path.."/"..y) and y ~= "" then
  14. local file = fs.open(path.."/"..y,"w")
  15. local contents = libbb.read_file(user,repo,branch,path.."/"..y)
  16. file.write(contents)
  17. file.flush()
  18. file.close()
  19. end
  20. end
  21. if ret[1] == "" then
  22. return
  23. end
  24. mkdirs(user, repo, branch, path.."/"..v);
  25. end
  26. end
  27.  
  28.  
  29. local function install(user,repo,branch,path)
  30. mkdirs(user,repo,branch,path)
  31. end
  32.  
  33.  
  34. install("scoopta","scaptos2-repo","default","brainfuck")
Advertisement
Add Comment
Please, Sign In to add comment