Compare commits

...

2 Commits

Author SHA1 Message Date
xomf
e62abe56d6 this prob better 2024-08-17 23:30:11 -04:00
xomf
9440379967 this prob better 2024-08-17 23:29:34 -04:00
2 changed files with 5 additions and 8 deletions

View File

@ -7,7 +7,7 @@ local require = function(path)
return __DEFAULT_IMPORT(path)
end
end
local KEYPADOS_UPDATE_HASH = "PJIEvsAncSvhKOqsLGVlxvzJ"
local KEYPADOS_UPDATE_HASH = "bKkYwsVcXKtXDBdkQPQTxFYR"
rawset(__BUNDLER_FILES, "updater.lua", function ()
local utils = require("utils.lua")
local LAST_USED = os.time()
@ -26,15 +26,14 @@ rawset(__BUNDLER_FILES, "updater.lua", function ()
if string.find(update_code_text, "^local __BUNDLER_FILES = {}") then
-- Make backup
fs.copy("startup.lua", "backup.lua")
local pattern = 'local KEYPADOS_UPDATE_HASH%s*=%s*"(.-)"'
local foundUpdateHash = inputString:match(pattern)
if KEYPADOS_UPDATE_HASH ~= foundUpdateHash then
if not string.find(update_code_text, KEYPADOS_UPDATE_HASH) then
local file = fs.open("startup.lua", "w")
file.write(update_code_text)
file.close()
os.reboot()
else
print("Nothing changed, not updating.")
sleep(50) -- delete this later
LAST_USED = os.time()
return
end

View File

@ -19,16 +19,14 @@ local function checkForUpdate()
-- Make backup
fs.copy("startup.lua", "backup.lua")
local pattern = 'local KEYPADOS_UPDATE_HASH%s*=%s*"(.-)"'
local foundUpdateHash = inputString:match(pattern)
if KEYPADOS_UPDATE_HASH ~= foundUpdateHash then
if not string.find(update_code_text, KEYPADOS_UPDATE_HASH) then
local file = fs.open("startup.lua", "w")
file.write(update_code_text)
file.close()
os.reboot()
else
print("Nothing changed, not updating.")
sleep(50) -- delete this later
LAST_USED = os.time()
return
end