Meow[ajs[df0onaes[d

This commit is contained in:
Gvidas Juknevičius 2025-06-02 10:42:08 +03:00
parent d72dd57e6a
commit 8026749270
Signed by: MCorange
GPG Key ID: 5BE6B533CB76FE86

View File

@ -2,12 +2,13 @@ local CURRENT_CLIENT_VERSION = "1.0.0.2"
local INSTALL_PATH = "/"
function http_get(url)
local req = http.get(url)
if not req then
print("FAIL " .. url)
end
local resp = req.readAll()
req.close()
return resp
end
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)
print("Latest: " .. manifest_json.version)
if manifest_json.version ~= CURRENT_CLIENT_VERSION then
print("Installing update...")
for path,url in pairs(manifest_json.sys_files) do
print("Writing " .. path)
for path, url in pairs(manifest_json.sys_files) do
print("W " .. path)
local file = fs.open(INSTALL_PATH .. path, "w")
file.write( http_get(url) )
file.write(http_get(url))
file.close()
print("Written.")
-- print("Written.")
end
print("Please reboot your device.")
@ -34,3 +33,4 @@ if manifest_json.version ~= CURRENT_CLIENT_VERSION then
else
print("No update availiable.")
end