Compare commits

..

No commits in common. "e62abe56d6c5da22afa96c3f9d7f783d69347f37" and "68a7d4eaa501a7fe5479588c04da60f7f1a511ff" have entirely different histories.

2 changed files with 8 additions and 5 deletions

View File

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

View File

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