-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.lua
More file actions
52 lines (43 loc) · 1.22 KB
/
Copy pathinstall.lua
File metadata and controls
52 lines (43 loc) · 1.22 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
local args = { ... }
local branch = "main"
if #args > 0 then
branch = args[1]
end
local repoURL = "https://raw.githubusercontent.com/Daxanius/harmony/" .. branch
-- List of files to download and their paths
local files = {
"/harmony.lua",
"/harmony/config.lua",
"/harmony/gui.lua",
"/harmony/lib.lua",
"/harmony/update.lua",
"/harmony/version.txt",
"/harmony/theme/default.lua"
}
-- Function to download and save a file
local function downloadFile(fileName)
local url = repoURL .. fileName
local response = http.get(url)
if response then
local fileContent = response.readAll()
response.close()
local filePath = fileName
local file = fs.open(filePath, "w")
file.write(fileContent)
file.close()
print("Updated " .. fileName)
else
print("Failed to download " .. fileName)
end
end
-- Remove basalt if it exists
if fs.exists("/basalt.lua") then
fs.delete("/basalt.lua")
end
-- Install basalt
shell.run("wget", "run", "https://raw.githubusercontent.com/Pyroxenium/Basalt/refs/heads/master/docs/install.lua", "packed")
-- Download all files
for _, file in ipairs(files) do
downloadFile(file)
end
print("Installation complete.")