-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstaller.lua
32 lines (24 loc) · 960 Bytes
/
installer.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
local shell = require("shell")
local filesystem = require("filesystem")
local scripts = {"src/AE2.lua", "src/Utility.lua", "Maintainer.lua"}
local paths = {"src", "lib"}
local function exists(filename)
return filesystem.exists(shell.getWorkingDirectory() .. "/" .. filename)
end
local repo = "https://raw.githubusercontent.com/Niels1006/Infinite-Maintainer/";
local branch = "master"
for i = 1, #paths do
if not filesystem.exists(shell.getWorkingDirectory() .. "/" .. paths[i]) then
filesystem.makeDirectory(shell.getWorkingDirectory() .. "/" .. paths[i]);
end
end
for i = 1, #scripts do
if exists(scripts[i]) then
filesystem.remove(shell.getWorkingDirectory() .. "/" .. scripts[i]);
end
shell.execute(string.format("wget %s%s/%s %s", repo, branch, scripts[i], scripts[i]));
end
if not exists("config.lua") then
shell.execute(string.format("wget %s%s/config.lua", repo, branch));
end
shell.execute("reboot");