fix(update): 优化更新逻辑,添加错误提示并清理冗余代码
移除所有脚本文件的头部注释模板 删除installer.lua中未使用的splitCsv函数 重构静默更新逻辑,改用loadfile替代os.run以正确捕获执行错误 添加更新错误追踪机制,在界面版本指示器处显示失败提示 修复更新成功的判断条件
This commit is contained in:
+2
-18
@@ -1,11 +1,4 @@
|
||||
--[[
|
||||
Author: HenryDu8133 813367384@qq.com
|
||||
Date: 2026-05-16 23:26:53
|
||||
LastEditors: HenryDu8133 813367384@qq.com
|
||||
LastEditTime: 2026-07-11 00:11:28
|
||||
FilePath: \TicketMachine\installer.lua
|
||||
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
--]]
|
||||
|
||||
local URL_ERROR = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/error.dfpwm"
|
||||
local URL_PASS = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/pass.dfpwm"
|
||||
local URL_GATE = "http://gitea.fse-media.group/Henry_Du/FSE-Ticket.sys/raw/branch/main/gate.lua"
|
||||
@@ -17,16 +10,7 @@ local function trim(s)
|
||||
return (tostring(s or ""):gsub("^%s+", ""):gsub("%s+$", ""))
|
||||
end
|
||||
|
||||
local function splitCsv(s)
|
||||
local out = {}
|
||||
s = trim(s)
|
||||
if #s == 0 then return out end
|
||||
for part in s:gmatch("[^,/%s]+") do
|
||||
local v = trim(part)
|
||||
if #v > 0 then table.insert(out, v) end
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
|
||||
|
||||
local function writeFile(path, content, binary)
|
||||
|
||||
Reference in New Issue
Block a user