forked from xyqyear/auto-crossbreeding
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.lua
More file actions
66 lines (57 loc) · 1.41 KB
/
Copy pathinstall.lua
File metadata and controls
66 lines (57 loc) · 1.41 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--[[
Change path to github location to pull from (for those who fork...)
Ensure you have the '/ at the end
tinyUrl: https://bit.ly/2Vgn4ki
]]
local path = "https://raw.githubusercontent.com/AtomicGrog/auto-crossbreeding/"
local shell = require("shell")
local filesystem = require("filesystem")
local args = {...}
local scripts = {
"action.lua",
"database.lua",
"gps.lua",
"posUtil.lua",
"scanner.lua",
"signal.lua",
"autoStat.lua",
"autoCrossbreed.lua",
"autoSpread.lua",
"install.lua",
"tasks.lua",
"cleanup.lua",
"autoFill.lua"
}
local function exists(filename)
return filesystem.exists(shell.getWorkingDirectory().."/"..filename)
end
local branch
local option
if #args == 0 then
branch = "main"
else
branch = args[1]
end
if branch == "help" then
print("Usage:\n./install or ./install [branch] [updateconfig]")
return
end
if #args == 2 then
option = args[2]
end
for i=1, #scripts do
shell.execute("wget -f "..path..branch.."/"..scripts[i])
end
if not exists("config.lua") then
shell.execute("wget "..path..branch.."/config.lua")
end
if option == "updateconfig" then
if exists("config.lua") then
if exists("config.bak") then
shell.execute("rm config.bak")
end
shell.execute("mv config.lua config.bak")
print("Moved config.lua to config.bak")
end
shell.execute("wget "..branch.."/config.lua")
end