hopefully this will stop it from autoupdating for no reason :3
This commit is contained in:
parent
4a50afc920
commit
c47f089395
16
keypadOS.lua
16
keypadOS.lua
|
@ -26,11 +26,17 @@ rawset(__BUNDLER_FILES, "updater.lua", function ()
|
||||||
if string.find(update_code_text, "^local __BUNDLER_FILES = {}") then
|
if string.find(update_code_text, "^local __BUNDLER_FILES = {}") then
|
||||||
--make backup
|
--make backup
|
||||||
fs.copy("startup.lua","backup.lua")
|
fs.copy("startup.lua","backup.lua")
|
||||||
--install update
|
local startup_file = fs.open("startup.lua", "r")
|
||||||
local file = fs.open("startup.lua", "w")
|
local startup_contents = file.readAll()
|
||||||
file.write(update_code_text)
|
|
||||||
file.close()
|
file.close()
|
||||||
os.reboot()
|
if update_code_text ~= startup_contents then
|
||||||
|
local file = fs.open("startup.lua", "w")
|
||||||
|
file.write(update_code_text)
|
||||||
|
file.close()
|
||||||
|
os.reboot()
|
||||||
|
else
|
||||||
|
print("Nothing changed, not updating.")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
print("Bad file download (core)")
|
print("Bad file download (core)")
|
||||||
end
|
end
|
||||||
|
@ -175,7 +181,7 @@ rawset(__BUNDLER_FILES, "ui.lua", function ()
|
||||||
end)
|
end)
|
||||||
if not status and err ~= "Terminated" then
|
if not status and err ~= "Terminated" then
|
||||||
print("Error detected: " .. err)
|
print("Error detected: " .. err)
|
||||||
monitor.clear()
|
utils.MonReset(0.5)
|
||||||
fs.delete("basalt.lua")
|
fs.delete("basalt.lua")
|
||||||
fs.delete("startup.lua")
|
fs.delete("startup.lua")
|
||||||
fs.copy("backup.lua", "startup.lua")
|
fs.copy("backup.lua", "startup.lua")
|
||||||
|
|
|
@ -114,7 +114,7 @@ function mod.InitUi()
|
||||||
|
|
||||||
if not status and err ~= "Terminated" then
|
if not status and err ~= "Terminated" then
|
||||||
print("Error detected: " .. err)
|
print("Error detected: " .. err)
|
||||||
monitor.clear()
|
utils.MonReset(0.5)
|
||||||
fs.delete("basalt.lua")
|
fs.delete("basalt.lua")
|
||||||
fs.delete("startup.lua")
|
fs.delete("startup.lua")
|
||||||
fs.copy("backup.lua", "startup.lua")
|
fs.copy("backup.lua", "startup.lua")
|
||||||
|
|
|
@ -19,11 +19,19 @@ local function checkForUpdate()
|
||||||
--make backup
|
--make backup
|
||||||
fs.copy("startup.lua","backup.lua")
|
fs.copy("startup.lua","backup.lua")
|
||||||
|
|
||||||
--install update
|
local startup_file = fs.open("startup.lua", "r")
|
||||||
local file = fs.open("startup.lua", "w")
|
local startup_contents = file.readAll()
|
||||||
file.write(update_code_text)
|
|
||||||
file.close()
|
file.close()
|
||||||
os.reboot()
|
|
||||||
|
if update_code_text ~= startup_contents then
|
||||||
|
local file = fs.open("startup.lua", "w")
|
||||||
|
file.write(update_code_text)
|
||||||
|
file.close()
|
||||||
|
os.reboot()
|
||||||
|
else
|
||||||
|
print("Nothing changed, not updating.")
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
print("Bad file download (core)")
|
print("Bad file download (core)")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user