Files
LeonOS/data/computercraft/lua/rom/packages/example-pkg/1.0.0/programs/example.lua
Leonmmcoset fb33b53b42 feat(包管理器): 实现LeonOS包管理系统基础功能
添加包管理器核心程序(pkg.lua)及相关支持文件
- 实现包安装、更新、移除、列表、搜索等功能
- 添加包元数据结构和本地存储管理
- 包含示例包和命令补全支持
- 更新系统版本至0.3.0
2025-09-01 22:03:22 +08:00

28 lines
828 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 示例包程序
local colors = require('colors')
function drawTopBar()
local w, h = term.getSize()
term.setBackgroundColor(colors.cyan)
term.setTextColor(colors.white)
term.setCursorPos(1, 1)
term.clearLine()
local title = "Example Package v1.0.0"
local pos = math.floor((w - #title) / 2) + 1
term.setCursorPos(pos, 1)
term.write(title)
term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
term.setCursorPos(1, 3)
end
drawTopBar()
print("\n这是一个示例包展示了LeonOS包管理器的功能。")
print("\n使用方法:")
print(" pkg install example-pkg - 安装此包")
print(" pkg remove example-pkg - 卸载此包")
print(" pkg list - 列出已安装的包")
print("\n按任意键退出...")
os.pullEvent("key")
term.clear()
term.setCursorPos(1, 1)