forked from knijn/musicify
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.lua
45 lines (38 loc) · 1.19 KB
/
install.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
33
34
35
36
37
38
39
40
41
42
43
local baseRepoURL = "http://raw.githubusercontent.com/LeakedBuffalo7907/PocketPod/main"
local function downloadFile(path, name)
local status = "Downloaded"
if fs.exists(path .. name) then
fs.delete(path .. name)
status = "Updated"
end
local F = fs.open(path .. name, "w")
F.write(http.get(baseRepoURL .. path .. name).readAll())
F.close()
term.setTextColor(colors.lime)
print(name .. " " .. status)
term.setTextColor(colors.white)
end
local function checkFile(path, name)
if not fs.exists(path .. name) then
downloadFile(path, name)
end
end
local uptodate = false
local webversion = http.get(baseRepoURL .. "/CurrentVersion.txt")
local currentVersion = webversion.readAll()
webversion.close()
local oldUser = fs.exists("/CurrentVersion.txt")
if oldUser then
print("Old install detected, Reinstalling Now")
else
print("Installing now")
end
downloadFile("/", "CurrentVersion.txt")
checkFile("/", "Config.txt")
downloadFile("/", "PodOS.lua")
downloadFile("/", "startup.lua")
downloadFile("/lib/", "PrimeUI.lua")
term.setTextColor(colors.blue)
print("Pocket Pod Installed " .. currentVersion)
term.setTextColor(colors.white)
return;