From f3313c3e7f408db3464fe3918db545011644bc4a Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Tue, 2 Sep 2025 12:46:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor(installer):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=99=A8=E7=89=88=E6=9C=AC=E8=87=B30.3.6=20B?= =?UTF-8?q?eta=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构示例包文件结构,合并程序文件并移除补全功能 在app.lua中添加shell和applist模块依赖 --- .../packages/example-pkg/1.0.0/completions/example.lua | 10 ---------- .../example-pkg/1.0.0/{programs => }/example.lua | 0 .../lua/packages/example-pkg/1.0.0/package.json | 3 +-- data/computercraft/lua/rom/programs/app.lua | 3 +++ installer.lua | 2 +- 5 files changed, 5 insertions(+), 13 deletions(-) delete mode 100644 data/computercraft/lua/packages/example-pkg/1.0.0/completions/example.lua rename data/computercraft/lua/packages/example-pkg/1.0.0/{programs => }/example.lua (100%) diff --git a/data/computercraft/lua/packages/example-pkg/1.0.0/completions/example.lua b/data/computercraft/lua/packages/example-pkg/1.0.0/completions/example.lua deleted file mode 100644 index e924b4a..0000000 --- a/data/computercraft/lua/packages/example-pkg/1.0.0/completions/example.lua +++ /dev/null @@ -1,10 +0,0 @@ --- example command completion - -local shell = require('shell') -local completion = require('completion') - --- Set up completion for example command -shell.setCompletionFunction('example', completion.build({ - -- 这里可以添加example命令的补全逻辑 - completion.choice{'--help', '-h'} -})) \ No newline at end of file diff --git a/data/computercraft/lua/packages/example-pkg/1.0.0/programs/example.lua b/data/computercraft/lua/packages/example-pkg/1.0.0/example.lua similarity index 100% rename from data/computercraft/lua/packages/example-pkg/1.0.0/programs/example.lua rename to data/computercraft/lua/packages/example-pkg/1.0.0/example.lua diff --git a/data/computercraft/lua/packages/example-pkg/1.0.0/package.json b/data/computercraft/lua/packages/example-pkg/1.0.0/package.json index 09b109d..7bcd2e6 100644 --- a/data/computercraft/lua/packages/example-pkg/1.0.0/package.json +++ b/data/computercraft/lua/packages/example-pkg/1.0.0/package.json @@ -6,7 +6,6 @@ "license": "MIT", "dependencies": {}, "files": [ - "programs/example.lua", - "completions/example.lua" + "example.lua" ] } \ No newline at end of file diff --git a/data/computercraft/lua/rom/programs/app.lua b/data/computercraft/lua/rom/programs/app.lua index 7e25c96..37f666c 100644 --- a/data/computercraft/lua/rom/programs/app.lua +++ b/data/computercraft/lua/rom/programs/app.lua @@ -1,5 +1,8 @@ -- app.lua - Application launcher for LeonOS local fs = require("fs") +local shell = require("shell") +local applist = require("applist") + local function show_help() print("Usage: app [arguments]") print("Runs an application from the /app directory") diff --git a/installer.lua b/installer.lua index 6d651d8..98c25f9 100644 --- a/installer.lua +++ b/installer.lua @@ -1,5 +1,5 @@ -- LeonOS installer -local INSTALLER_VERSION = "0.3.6 Beta 4" +local INSTALLER_VERSION = "0.3.6 Beta 5" local DEFAULT_ROM_DIR = "/leonos" print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")