-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate.lua
More file actions
65 lines (56 loc) · 1.37 KB
/
update.lua
File metadata and controls
65 lines (56 loc) · 1.37 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
-- AE2 Inscriber Crafter Updater
-- Preserves your config.lua
local baseUrl = "https://raw.githubusercontent.com/athompson-hoho/ae2-inscriber-crafta/main/"
-- Note: config.lua is NOT in this list
local files = {
"startup.lua",
"lib/log.lua",
"lib/peripherals.lua",
"lib/inventory.lua",
"lib/recipes.lua",
"lib/jobs.lua",
"lib/ui.lua",
"install.lua",
"update.lua",
"test-chest.lua",
"test-inscriber.lua",
"test-transfer.lua",
"test-recipes.lua",
"test-network.lua",
"test-ex-inscriber.lua",
}
print("AE2 Inscriber Crafter Updater")
print("==============================")
print("")
print("Note: Your config.lua will NOT be changed.")
print("")
-- Ensure lib directory exists
if not fs.exists("lib") then
fs.makeDir("lib")
end
-- Download files
local updated = 0
local failed = 0
for _, file in ipairs(files) do
print("Updating: " .. file)
local url = baseUrl .. file
-- Delete existing file first
if fs.exists(file) then
fs.delete(file)
end
local ok = shell.run("wget", url, file)
if not ok then
print(" FAILED!")
failed = failed + 1
else
print(" OK")
updated = updated + 1
end
end
print("")
print("Updated: " .. updated .. " files")
if failed > 0 then
print("Failed: " .. failed .. " files")
end
print("")
print("Run 'reboot' to apply updates.")