refactor: remove unused update functions and variables
This commit is contained in:
@@ -655,32 +655,7 @@ local function clickSound() end
|
||||
-- ###########################
|
||||
-- Background Tasks
|
||||
-- ###########################
|
||||
local function getLastUpdateVersion()
|
||||
if not fs.exists(".last_update_version") then return nil end
|
||||
local f = fs.open(".last_update_version", "r")
|
||||
if not f then return nil end
|
||||
local v = f.readAll()
|
||||
f.close()
|
||||
return v
|
||||
end
|
||||
|
||||
local function setLastUpdateVersion(v)
|
||||
local f = fs.open(".last_update_version", "w")
|
||||
if f then f.write(tostring(v)); f.close() end
|
||||
end
|
||||
|
||||
local function runSilentMachineUpdate()
|
||||
if not fs.exists('update_machine.lua') then
|
||||
return false, "update_machine.lua not found"
|
||||
end
|
||||
local baseEnv = (getfenv and getfenv()) or _ENV or _G
|
||||
local env = setmetatable({ AUTO_UPDATE_SILENT = true }, { __index = baseEnv })
|
||||
local fn, err = loadfile('update_machine.lua', env)
|
||||
if not fn then return false, err end
|
||||
local ok, res = pcall(fn, '--silent')
|
||||
if not ok then return false, tostring(res) end
|
||||
return true, true
|
||||
end
|
||||
|
||||
local lastUpdateError = nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user