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,4 +1,4 @@
|
|||||||
_G._HOST = _G._HOST .. " (LeonOS 1.6.0)"
|
_G._HOST = _G._HOST .. " (LeonOS 0.1.0)"
|
||||||
|
|
||||||
local fs = rawget(_G, "fs")
|
local fs = rawget(_G, "fs")
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ local reboot = pull(os, "restart")
|
|||||||
local rc = {
|
local rc = {
|
||||||
_NAME = "LeonOS",
|
_NAME = "LeonOS",
|
||||||
_VERSION = {
|
_VERSION = {
|
||||||
major = 1,
|
major = 0,
|
||||||
minor = 6,
|
minor = 1,
|
||||||
patch = 0
|
patch = 0
|
||||||
},
|
},
|
||||||
queueEvent = pull(os, "queueEvent"),
|
queueEvent = pull(os, "queueEvent"),
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
-- LeonOS installer
|
-- LeonOS installer
|
||||||
|
|
||||||
local DEFAULT_ROM_DIR = "/rc"
|
local DEFAULT_ROM_DIR = "/rc"
|
||||||
print("Start loading LeonOS installer...\n")
|
print("Start loading LeonOS installer...")
|
||||||
print("[Installer] Loading module 1\n")
|
print("[Installer] Loading module 1")
|
||||||
local function dl(f)
|
local function dl(f)
|
||||||
local hand, err = http.get(f, nil, true)
|
local hand, err = http.get(f, nil, true)
|
||||||
if not hand then
|
if not hand then
|
||||||
@@ -14,41 +14,41 @@ local function dl(f)
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
end
|
end
|
||||||
print("[Installer] Loading done.\n")
|
print("[Installer] Loading done.")
|
||||||
print("[Installer] Loading module 2\n")
|
print("[Installer] Loading module 2")
|
||||||
-- set up package.loaded for LeonOS libs
|
-- set up package.loaded for LeonOS libs
|
||||||
package.loaded.rc = {
|
package.loaded.rc = {
|
||||||
expect = require("cc.expect").expect,
|
expect = require("cc.expect").expect,
|
||||||
write = write, sleep = sleep
|
write = write, sleep = sleep
|
||||||
}
|
}
|
||||||
print("[Installer] Loading done.\n")
|
print("[Installer] Loading done.")
|
||||||
print("[Installer] Loading module 3\n")
|
print("[Installer] Loading module 3")
|
||||||
package.loaded.term = term
|
package.loaded.term = term
|
||||||
package.loaded.colors = colors
|
package.loaded.colors = colors
|
||||||
_G.require = require
|
_G.require = require
|
||||||
print("[Installer] Loading done.\n")
|
print("[Installer] Loading done.")
|
||||||
print("[Installer] Loading module 4\n")
|
print("[Installer] Loading module 4")
|
||||||
function term.at(x, y)
|
function term.at(x, y)
|
||||||
term.setCursorPos(x, y)
|
term.setCursorPos(x, y)
|
||||||
return term
|
return term
|
||||||
end
|
end
|
||||||
print("[Installer] Loading done.\n")
|
print("[Installer] Loading done.")
|
||||||
print("[Installer] Loading module 5\n")
|
print("[Installer] Loading module 5")
|
||||||
local function ghload(f, c)
|
local function ghload(f, c)
|
||||||
return assert(load(dl("https://gh.catmak.name/https://raw.githubusercontent.com/"..f),
|
return assert(load(dl("https://gh.catmak.name/https://raw.githubusercontent.com/"..f),
|
||||||
"="..(c or f), "t", _G))()
|
"="..(c or f), "t", _G))()
|
||||||
end
|
end
|
||||||
print("[Installer] Loading done.\n")
|
print("[Installer] Loading done.")
|
||||||
print("[Installer] Loading module 6\n")
|
print("[Installer] Loading module 6")
|
||||||
local json = ghload("rxi/json.lua/master/json.lua", "ghload(json)")
|
local json = ghload("rxi/json.lua/master/json.lua", "ghload(json)")
|
||||||
package.loaded["rc.json"] = json
|
package.loaded["rc.json"] = json
|
||||||
print("[Installer] Loading module 7\n")
|
print("[Installer] Loading module 7")
|
||||||
local function rcload(f)
|
local function rcload(f)
|
||||||
return ghload(
|
return ghload(
|
||||||
"Leonmmcoset/LeonOS/refs/heads/main/data/computercraft/lua/rom/"..f, f)
|
"Leonmmcoset/LeonOS/refs/heads/main/data/computercraft/lua/rom/"..f, f)
|
||||||
end
|
end
|
||||||
print("[Installer] Loading done.\n")
|
print("[Installer] Loading done.")
|
||||||
print("[Installer] Loading module 8\n")
|
print("[Installer] Loading module 8")
|
||||||
-- get LeonOS's textutils with its extra utilities
|
-- get LeonOS's textutils with its extra utilities
|
||||||
local tu = rcload("apis/textutils.lua")
|
local tu = rcload("apis/textutils.lua")
|
||||||
|
|
||||||
@@ -86,9 +86,9 @@ for y=2, term.getSize() do
|
|||||||
end
|
end
|
||||||
term.at(1, 2)
|
term.at(1, 2)
|
||||||
tu.coloredPrint(colors.yellow,
|
tu.coloredPrint(colors.yellow,
|
||||||
"LeonOS Installer\n=======================")
|
"LeonOS Installer (v".._VERSION..")\n=======================")
|
||||||
print("You are going to install LeonOS to your computer.")
|
tu.coloredPrint("You are going to install LeonOS to your computer.")
|
||||||
print("This will overwrite any existing files 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
|
||||||
|
|||||||
Reference in New Issue
Block a user