mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
feat: 更新LeonOS版本至0.1.9并添加欢迎信息
- 将LeonOS版本从0.1.8升级至0.1.9 - 在shell启动时添加欢迎信息 - 改进ver程序界面,添加顶部名称栏 - 简化安装程序流程,默认使用/leonos目录
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
_G._HOST = _G._HOST .. " (LeonOS 0.1.8)"
|
_G._HOST = _G._HOST .. " (LeonOS 0.1.9)"
|
||||||
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 = 8
|
patch = 9
|
||||||
},
|
},
|
||||||
queueEvent = pull(os, "queueEvent"),
|
queueEvent = pull(os, "queueEvent"),
|
||||||
startTimer = pull(os, "startTimer"),
|
startTimer = pull(os, "startTimer"),
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ if os.version then
|
|||||||
else
|
else
|
||||||
textutils.coloredPrint(colors.yellow, rc.version(), colors.white)
|
textutils.coloredPrint(colors.yellow, rc.version(), colors.white)
|
||||||
end
|
end
|
||||||
|
textutils.coloredPrint(colors.yellow, "Welcome using the beta version of LeonOS!"colors.white)
|
||||||
|
|
||||||
thread.vars().parentShell = thread.id()
|
thread.vars().parentShell = thread.id()
|
||||||
shell.init(_ENV)
|
shell.init(_ENV)
|
||||||
|
|||||||
@@ -2,5 +2,24 @@
|
|||||||
local rc = require("rc")
|
local rc = require("rc")
|
||||||
local textutils = require("textutils")
|
local textutils = require("textutils")
|
||||||
|
|
||||||
|
-- 程序顶部名称栏
|
||||||
|
local term = require("term")
|
||||||
|
local colors = require("colors")
|
||||||
|
|
||||||
|
-- 保存当前颜色设置
|
||||||
|
local old_fg = term.getTextColor()
|
||||||
|
local old_bg = term.getBackgroundColor()
|
||||||
|
|
||||||
|
-- 设置名称栏颜色并显示
|
||||||
|
term.setTextColor(colors.white)
|
||||||
|
term.setBackgroundColor(colors.cyan)
|
||||||
|
term.at(1, 1).clearLine()
|
||||||
|
term.at(1, 1).write("=== LeonOS Version ===")
|
||||||
|
|
||||||
|
-- 恢复颜色设置
|
||||||
|
term.setTextColor(old_fg)
|
||||||
|
term.setBackgroundColor(old_bg)
|
||||||
|
term.at(1, 2)
|
||||||
|
|
||||||
-- Display LeonOS version
|
-- Display LeonOS version
|
||||||
textutils.coloredPrint(colors.yellow, rc.version(), colors.white)
|
textutils.coloredPrint(colors.yellow, rc.version(), colors.white)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- LeonOS installer
|
-- LeonOS installer
|
||||||
local INSTALLER_VERSION = "0.1.8"
|
local INSTALLER_VERSION = "0.1.9"
|
||||||
local DEFAULT_ROM_DIR = "/leonos"
|
local DEFAULT_ROM_DIR = "/leonos"
|
||||||
|
|
||||||
print("Start loading LeonOS installer...")
|
print("Start loading LeonOS installer...")
|
||||||
@@ -88,8 +88,8 @@ end
|
|||||||
term.at(1, 2)
|
term.at(1, 2)
|
||||||
tu.coloredPrint(colors.yellow,
|
tu.coloredPrint(colors.yellow,
|
||||||
"LeonOS Installer (v"..INSTALLER_VERSION..")\n=======================")
|
"LeonOS Installer (v"..INSTALLER_VERSION..")\n=======================")
|
||||||
tu.coloredPrint("You are going to install LeonOS to your computer.")
|
tu.coloredPrint("You are going to install LeonOS "..rc.version().." to your computer.")
|
||||||
tu.coloredPrint("This will ",colors.red,"overwrite any existing files", colors.white, " in the installation directory.")
|
tu.coloredPrint("This will ",colors.red,"OVERWRITE any existing files", colors.white, " in the installation directory.")
|
||||||
tu.coloredPrint(colors.yellow, "Are you sure? (y/n)")
|
tu.coloredPrint(colors.yellow, "Are you sure? (y/n)")
|
||||||
local confirm = read()
|
local confirm = read()
|
||||||
if confirm ~= "y" then
|
if confirm ~= "y" then
|
||||||
@@ -98,20 +98,16 @@ if confirm ~= "y" then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local ROM_DIR
|
local ROM_DIR
|
||||||
tu.coloredPrint("Enter installation directory ", colors.yellow, "[",
|
-- tu.coloredPrint("Enter installation directory ", colors.yellow, "[",
|
||||||
colors.lightBlue, DEFAULT_ROM_DIR, colors.yellow, "]")
|
-- colors.lightBlue, DEFAULT_ROM_DIR, colors.yellow, "]")
|
||||||
tu.coloredWrite(colors.yellow, "$ installer >>>")
|
ROM_DIR = DEFAULT_ROM_DIR
|
||||||
|
|
||||||
ROM_DIR = read()
|
|
||||||
if #ROM_DIR == 0 then ROM_DIR = DEFAULT_ROM_DIR end
|
|
||||||
|
|
||||||
ROM_DIR = "/"..shell.resolve(ROM_DIR)
|
ROM_DIR = "/"..shell.resolve(ROM_DIR)
|
||||||
|
|
||||||
settings.set("LeonOS.rom_dir", ROM_DIR)
|
settings.set("LeonOS.rom_dir", ROM_DIR)
|
||||||
settings.save()
|
settings.save()
|
||||||
|
|
||||||
tu.coloredPrint(colors.white, "Installing LeonOS to ", colors.lightBlue,
|
tu.coloredPrint(colors.white, "Installing LeonOS "..rc.version().."...", colors.white)
|
||||||
ROM_DIR, colors.white)
|
|
||||||
|
|
||||||
local function bullet(t)
|
local function bullet(t)
|
||||||
tu.coloredWrite(colors.red, "- ", colors.white, t)
|
tu.coloredWrite(colors.red, "- ", colors.white, t)
|
||||||
|
|||||||
Reference in New Issue
Block a user