mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
fix: 更新LeonOS版本号至0.1.0并优化安装程序输出
将LeonOS版本号从1.6.0降级至0.1.0以反映实际开发阶段 移除安装程序中的多余换行符并使用coloredPrint统一输出样式
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
-- LeonOS installer
|
||||
|
||||
local DEFAULT_ROM_DIR = "/rc"
|
||||
print("Start loading LeonOS installer...\n")
|
||||
print("[Installer] Loading module 1\n")
|
||||
print("Start loading LeonOS installer...")
|
||||
print("[Installer] Loading module 1")
|
||||
local function dl(f)
|
||||
local hand, err = http.get(f, nil, true)
|
||||
if not hand then
|
||||
@@ -14,41 +14,41 @@ local function dl(f)
|
||||
|
||||
return data
|
||||
end
|
||||
print("[Installer] Loading done.\n")
|
||||
print("[Installer] Loading module 2\n")
|
||||
print("[Installer] Loading done.")
|
||||
print("[Installer] Loading module 2")
|
||||
-- set up package.loaded for LeonOS libs
|
||||
package.loaded.rc = {
|
||||
expect = require("cc.expect").expect,
|
||||
write = write, sleep = sleep
|
||||
}
|
||||
print("[Installer] Loading done.\n")
|
||||
print("[Installer] Loading module 3\n")
|
||||
print("[Installer] Loading done.")
|
||||
print("[Installer] Loading module 3")
|
||||
package.loaded.term = term
|
||||
package.loaded.colors = colors
|
||||
_G.require = require
|
||||
print("[Installer] Loading done.\n")
|
||||
print("[Installer] Loading module 4\n")
|
||||
print("[Installer] Loading done.")
|
||||
print("[Installer] Loading module 4")
|
||||
function term.at(x, y)
|
||||
term.setCursorPos(x, y)
|
||||
return term
|
||||
end
|
||||
print("[Installer] Loading done.\n")
|
||||
print("[Installer] Loading module 5\n")
|
||||
print("[Installer] Loading done.")
|
||||
print("[Installer] Loading module 5")
|
||||
local function ghload(f, c)
|
||||
return assert(load(dl("https://gh.catmak.name/https://raw.githubusercontent.com/"..f),
|
||||
"="..(c or f), "t", _G))()
|
||||
end
|
||||
print("[Installer] Loading done.\n")
|
||||
print("[Installer] Loading module 6\n")
|
||||
print("[Installer] Loading done.")
|
||||
print("[Installer] Loading module 6")
|
||||
local json = ghload("rxi/json.lua/master/json.lua", "ghload(json)")
|
||||
package.loaded["rc.json"] = json
|
||||
print("[Installer] Loading module 7\n")
|
||||
print("[Installer] Loading module 7")
|
||||
local function rcload(f)
|
||||
return ghload(
|
||||
"Leonmmcoset/LeonOS/refs/heads/main/data/computercraft/lua/rom/"..f, f)
|
||||
end
|
||||
print("[Installer] Loading done.\n")
|
||||
print("[Installer] Loading module 8\n")
|
||||
print("[Installer] Loading done.")
|
||||
print("[Installer] Loading module 8")
|
||||
-- get LeonOS's textutils with its extra utilities
|
||||
local tu = rcload("apis/textutils.lua")
|
||||
|
||||
@@ -86,9 +86,9 @@ for y=2, term.getSize() do
|
||||
end
|
||||
term.at(1, 2)
|
||||
tu.coloredPrint(colors.yellow,
|
||||
"LeonOS Installer\n=======================")
|
||||
print("You are going to install LeonOS to your computer.")
|
||||
print("This will overwrite any existing files in the installation directory.")
|
||||
"LeonOS Installer (v".._VERSION..")\n=======================")
|
||||
tu.coloredPrint("You are going to install LeonOS to your computer.")
|
||||
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)")
|
||||
local confirm = read()
|
||||
if confirm ~= "y" then
|
||||
|
||||
Reference in New Issue
Block a user