movescript/install.lua

25 lines
735 B
Lua
Raw Normal View History

2022-12-17 15:15:34 +00:00
--[[
Installation script for installing all libraries.
2022-12-17 15:39:59 +00:00
Run `wget run https://raw.githubusercontent.com/andrewlalis/movescript/main/install.lua`
2022-12-17 15:15:34 +00:00
to run the installer on your device.
]]--
2022-12-17 15:39:59 +00:00
BASE_URL = "https://raw.githubusercontent.com/andrewlalis/movescript/main/"
2022-12-17 15:15:34 +00:00
2022-12-17 15:35:11 +00:00
SCRIPTS = {
"movescript.lua",
"itemscript.lua"
}
-- Create a local executable to re-install, instead of having to run this file via wget.
local f = io.open("install-movescript.lua", "w")
for _, script in pairs(SCRIPTS) do
2022-12-17 15:39:59 +00:00
url = BASE_URL .. script
2022-12-17 15:35:11 +00:00
cmd = "wget " .. url .. " " .. script
shell.run(cmd)
2022-12-17 20:42:42 +00:00
f:write("if fs.exists(\"" .. script .. "\") then fs.delete(\"" .. script .. "\") end")
2022-12-17 15:35:11 +00:00
f:write("shell.run(\"" .. cmd .. "\")")
end
f:close()