Meow[ajs[df0onaes[d
This commit is contained in:
parent
d72dd57e6a
commit
8026749270
|
@ -2,12 +2,13 @@ local CURRENT_CLIENT_VERSION = "1.0.0.2"
|
||||||
local INSTALL_PATH = "/"
|
local INSTALL_PATH = "/"
|
||||||
|
|
||||||
function http_get(url)
|
function http_get(url)
|
||||||
|
|
||||||
local req = http.get(url)
|
local req = http.get(url)
|
||||||
|
if not req then
|
||||||
|
print("FAIL " .. url)
|
||||||
|
end
|
||||||
local resp = req.readAll()
|
local resp = req.readAll()
|
||||||
req.close()
|
req.close()
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
print("Device Version: " .. CURRENT_CLIENT_VERSION)
|
print("Device Version: " .. CURRENT_CLIENT_VERSION)
|
||||||
|
@ -17,16 +18,14 @@ local manifest = http_get("https://git.mcorangehq.xyz/xomf/slabOS/raw/branch/mai
|
||||||
local manifest_json = textutils.unserialiseJSON(manifest)
|
local manifest_json = textutils.unserialiseJSON(manifest)
|
||||||
print("Latest: " .. manifest_json.version)
|
print("Latest: " .. manifest_json.version)
|
||||||
if manifest_json.version ~= CURRENT_CLIENT_VERSION then
|
if manifest_json.version ~= CURRENT_CLIENT_VERSION then
|
||||||
|
|
||||||
print("Installing update...")
|
print("Installing update...")
|
||||||
|
|
||||||
for path,url in pairs(manifest_json.sys_files) do
|
for path, url in pairs(manifest_json.sys_files) do
|
||||||
print("Writing " .. path)
|
print("W " .. path)
|
||||||
local file = fs.open(INSTALL_PATH .. path, "w")
|
local file = fs.open(INSTALL_PATH .. path, "w")
|
||||||
file.write( http_get(url) )
|
file.write(http_get(url))
|
||||||
file.close()
|
file.close()
|
||||||
print("Written.")
|
-- print("Written.")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
print("Please reboot your device.")
|
print("Please reboot your device.")
|
||||||
|
@ -34,3 +33,4 @@ if manifest_json.version ~= CURRENT_CLIENT_VERSION then
|
||||||
else
|
else
|
||||||
print("No update availiable.")
|
print("No update availiable.")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user