feat: 添加ver命令并更新LeonOS版本至0.1.8

- 新增ver命令用于显示LeonOS版本信息
- 更新installer.lua和bios.lua中的版本号至0.1.8
- 为ver命令添加shell别名和补全功能
This commit is contained in:
2025-09-01 16:29:34 +08:00
parent d911c3af34
commit 565da37a34
5 changed files with 16 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
_G._HOST = _G._HOST .. " (LeonOS 0.1.7)" _G._HOST = _G._HOST .. " (LeonOS 0.1.8)"
local fs = rawget(_G, "fs") local fs = rawget(_G, "fs")
_G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom" _G._RC_ROM_DIR = _RC_ROM_DIR or (...) and fs.exists("/leonos") and "/leonos" or "/rom"
@@ -32,7 +32,7 @@ local rc = {
_VERSION = { _VERSION = {
major = 0, major = 0,
minor = 1, minor = 1,
patch = 7 patch = 8
}, },
queueEvent = pull(os, "queueEvent"), queueEvent = pull(os, "queueEvent"),
startTimer = pull(os, "startTimer"), startTimer = pull(os, "startTimer"),

View File

@@ -0,0 +1,6 @@
local shell = require("shell")
local completion = require("cc.shell.completion")
shell.setCompletionFunction("ver", completion.build(
-- ver命令不接受参数所以这里没有额外的补全选项
))

View File

@@ -67,7 +67,8 @@ local aliases = {
rs = "redstone", rs = "redstone",
sh = "shell", sh = "shell",
ps = "threads", ps = "threads",
restart = "reboot" restart = "reboot",
version = "ver"
} }
for k, v in pairs(aliases) do for k, v in pairs(aliases) do

View File

@@ -0,0 +1,5 @@
-- LeonOS version command
local rc = require("rc")
-- Display LeonOS version
print(rc.version())

View File

@@ -1,5 +1,5 @@
-- LeonOS installer -- LeonOS installer
local INSTALLER_VERSION = "0.1.7" local INSTALLER_VERSION = "0.1.8"
local DEFAULT_ROM_DIR = "/leonos" local DEFAULT_ROM_DIR = "/leonos"
print("Start loading LeonOS installer...") print("Start loading LeonOS installer...")