From 625f959b4e125cd493803a0080c6a0f69f4e1f1e Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 1 Sep 2025 22:10:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7=E8=87=B30.3.1=E5=B9=B6=E4=BF=AE=E5=A4=8D=E7=A9=BA?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新installer.lua、bios.lua和pkg.lua中的版本号至0.3.1 在pkg.lua中添加参数过滤逻辑,避免空参数导致的问题 --- data/computercraft/lua/bios.lua | 4 ++-- data/computercraft/lua/rom/programs/pkg.lua | 10 +++++++++- installer.lua | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/data/computercraft/lua/bios.lua b/data/computercraft/lua/bios.lua index 3cc742d..ebb9b59 100644 --- a/data/computercraft/lua/bios.lua +++ b/data/computercraft/lua/bios.lua @@ -1,4 +1,4 @@ -_G._HOST = _G._HOST .. " (LeonOS 0.3.0)" +_G._HOST = _G._HOST .. " (LeonOS 0.3.1)" local fs = rawget(_G, "fs") _G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom" @@ -32,7 +32,7 @@ local rc = { _VERSION = { major = 0, minor = 3, - patch = 0 + patch = 1 }, queueEvent = pull(os, "queueEvent"), startTimer = pull(os, "startTimer"), diff --git a/data/computercraft/lua/rom/programs/pkg.lua b/data/computercraft/lua/rom/programs/pkg.lua index b8897bc..73e82ed 100644 --- a/data/computercraft/lua/rom/programs/pkg.lua +++ b/data/computercraft/lua/rom/programs/pkg.lua @@ -381,4 +381,12 @@ local function main(args) end -- 运行主函数 -main({...}) \ No newline at end of file +local args = {...} +-- 过滤掉可能的空参数 +local filtered_args = {} +for _, arg in ipairs(args) do + if arg and arg ~= "" then + table.insert(filtered_args, arg) + end +end +main(filtered_args) \ No newline at end of file diff --git a/installer.lua b/installer.lua index 2f9428e..fae6e10 100644 --- a/installer.lua +++ b/installer.lua @@ -1,5 +1,5 @@ -- LeonOS installer -local INSTALLER_VERSION = "0.3.0" +local INSTALLER_VERSION = "0.3.1" local DEFAULT_ROM_DIR = "/leonos" print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")