Advertisement
Omsigames

installer_pastebin.lua

Dec 25th, 2024 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.77 KB | None | 0 0
  1. local shell = require("shell")
  2. local fs = require("filesystem")
  3. local repoFiles = {
  4.     {file = "init.lua",                 link = "Bq7r7ax1"},
  5.     {file = "json.lua",                 link = "S1xp1yvg"},
  6.     {file = "config.lua",               link = "MCQNRBnh"},
  7.     {file = "controllers.lua",          link = "Pu7xWjGb"},
  8.     {file = "utils.lua",                link = "pHwREF5r"},
  9.     {file = "grapes/Color.lua",         link = "gqNHhdEQ"},
  10.     {file = "grapes/Event.lua",         link = "yTNKPyDX"},
  11.     {file = "grapes/Filesystem.lua",    link = "KnKzuAeK"},
  12.     {file = "grapes/GUI.lua",           link = "PMkQCUVc"},
  13.     {file = "grapes/Image.lua",         link = "njzs2te0"},
  14.     {file = "grapes/Keyboard.lua",      link = "jy6YNds6"},
  15.     {file = "grapes/Number.lua",        link = "dYHbSf9i"},
  16.     {file = "grapes/Paths.lua",         link = "9w5zsW1A"},
  17.     {file = "grapes/Screen.lua",        link = "vnhPgFNE"},
  18.     {file = "grapes/Text.lua",          link = "wTyBUqw7"},
  19. }
  20. local launcherId = "n9bSKZ96"
  21. local installLoc = "/home/orms/"
  22.  
  23. if not fs.isDirectory(installLoc) then
  24.   fs.makeDirectory(installLoc)
  25. end
  26.  
  27. shell.setWorkingDirectory(installLoc)
  28.  
  29. for file, _ in fs.list(installLoc) do
  30.   print("Install location contains files within, wipe all? (Y - Yes/N - No)")
  31.   ::WipeInstDir::
  32.   local input = string.lower(io.read())
  33.   if input ~= "n" and input ~= "y" then
  34.     print("Invalid choice (Y/N)")
  35.     goto WipeInstDir
  36.   end
  37.  
  38.   if input == "y" then
  39.     for file, _ in fs.list(installLoc) do
  40.       fs.remove(installLoc .. file)
  41.     end
  42.   end
  43.   break
  44. end
  45.  
  46. if not fs.isDirectory(installLoc .. "grapes") then
  47.   fs.makeDirectory(installLoc .. "grapes")
  48. end
  49.  
  50. local OverwriteAll = false
  51. for _, data in pairs(repoFiles) do
  52.   if fs.exists(installLoc .. data.file) and not OverwriteAll then
  53.     print("File " .. data.file .. " already exists. Overwrite? (Y - Yes/N - No/A - All)")
  54.     ::OverwriteFile::
  55.     local input = string.lower(io.read())
  56.     if input ~= "n" and input ~= "y" and input ~= "a" then
  57.       print("Invalid choice (Y/N/A)")
  58.       goto OverwriteFile
  59.     end
  60.  
  61.     if input == "a" then
  62.       OverwriteAll = true
  63.       shell.execute("pastebin get -f " .. data.link .. " " .. data.file)
  64.     end
  65.  
  66.     if input == "y" then
  67.       shell.execute("pastebin get -f " .. data.link .. " " .. data.file)
  68.     end
  69.   else
  70.     shell.execute("pastebin get -f " .. data.link .. " " .. data.file)
  71.   end
  72. end
  73.  
  74. -- Launcher
  75. shell.execute("pastebin get -f " .. launcherId .. " " .. "/bin/orms.lua")
  76.  
  77. print("Add to startup? (Y - Yes/N - No)")
  78. ::AddToStartup::
  79. local input = string.lower(io.read())
  80. if input ~= "n" and input ~= "y" then
  81.   print("Invalid choice (Y/N)")
  82.   goto AddToStartup
  83. end
  84. if input == "y" then
  85.     io.open("/home/.shrc", "a"):write("orms.lua\n"):close()
  86. end
  87.  
  88. print("Install Complete")
  89.  
Tags: ORMS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement