guitarplayer616

SchematicBuilder

Jan 22nd, 2021 (edited)
515
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local filesystem = require("filesystem")
  2. local files = {
  3.   "gps",
  4.   "blueprint",
  5.   "inventory",
  6.   "NBTparser",
  7.   "NBTbuilder",
  8.   "ZigZagIterator",
  9.   "utils/class",
  10.   "utils/tools",
  11.   "utils/legacy_id_dictionary",
  12.   "utils/download",
  13. }
  14.  
  15. local repository = "https://raw.githubusercontent.com/GuitarMusashi616/SchematicBuilder/main/"
  16. local tArgs = {...}
  17.  
  18. if not filesystem.exists("/build") then
  19.   os.execute("mkdir /build")
  20.   os.execute("mkdir /build/utils")
  21.   for _,file in ipairs(files) do
  22.     os.execute("wget " .. repository .."source/".. file..".lua " .. "/build/" .. file ..".lua")
  23.   end
  24. else
  25.   if #tArgs == 0 then
  26.     print("Usage: download <schematic>")
  27.     print("       download -r")
  28.   elseif #tArgs == 1 then
  29.     if tArgs[1] == "-r" then
  30.       os.execute("rm /build/utils/*")
  31.       os.execute("rm /build/*")
  32.       os.execute("rmdir /build/utils")
  33.       os.execute("rmdir /build")
  34.     else
  35.       os.execute("wget " .. repository .. "schematics/" .. tArgs[1] .. " /build/" .. tArgs[1])
  36.     end
  37.   end
  38. end
  39.  
Add Comment
Please, Sign In to add comment