CultistaDeCrocs

atualizarMaquina.lua

Mar 19th, 2024
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. require("bibliotecas.atari")
  2.  
  3. function removeProgramas()
  4. print("Removendo programas nativos...")
  5.  
  6. if not shell.run("rm", "./*.lua") then
  7. printCor("Falha em remover programas.", colors.red)
  8. os.exit()
  9. end
  10. end
  11.  
  12. function removeBibliotecas()
  13. print("Removendo bibliotecas...")
  14.  
  15. if not shell.run("rm", "./bibliotecas") then
  16. printCor("Falha em remover bibliotecas.", colors.red)
  17. os.exit()
  18. end
  19. end
  20.  
  21. function copiaArquivos()
  22. print("Copiando arquivos do disco...")
  23.  
  24. if not shell.run("cp", "./disk/*", "./") then
  25. printCor("Falha em copiar arquivos.", colors.red)
  26. os.exit()
  27. end
  28. end
  29.  
  30. if fs.exists("./disk/") then
  31. removeProgramas()
  32. removeBibliotecas()
  33. copiaArquivos()
  34. printCor("Sucesso!", colors.green)
  35. else
  36. printCor("Disco não encontrado.", colors.red)
  37. end
Advertisement
Add Comment
Please, Sign In to add comment