8 个版本
0.1.1 | 2024 年 8 月 1 日 |
---|---|
0.1.0 | 2024 年 7 月 25 日 |
0.0.0 | 2024 年 7 月 15 日 |
#425 在 开发工具
710 每月下载量
58KB
1.5K SLoC
moonup
管理多个 MoonBit 安装
入门指南
如果您已安装 Rust 工具链,您可以使用 Cargo 轻松安装 moonup
cargo install moonup
或者您可以从 GitHub 发布 下载最新版本,手动解压并将可执行文件放入您的 PATH
目录中。
安装后,运行 moonup help
查看可用命令。
$ moonup help
Moonup is a tool to manage multiple MoonBit installations.
If you find any bugs or have a feature request, please open an issue on
GitHub: https://github.com/chawyehsu/moonup/issues
Usage: moonup [OPTIONS] <COMMAND>
Commands:
completions Generate shell completions
default Set the default toolchain
install Install or update a MoonBit toolchain [aliases: i]
pin Pin the MoonBit toolchain to a specific version
run Run a command with a specific toolchain
show Show installed and currently active toolchains
update Update MoonBit latest toolchain and moonup [aliases: u]
which Show the actual binary that will be run for a given command
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose... Increase logging verbosity
-q, --quiet... Decrease logging verbosity
-h, --help Print help
-V, --version Print version
工作原理
Moonup 允许您轻松安装多个 MoonBit 工具链并在它们之间切换。所有 MoonBit 工具链(包括核心标准库)都安装在 Moonup 的 toolchains
目录中。
Moonup 创建了占位符可执行文件,以替换 PATH 中的原始 MoonBit 可执行文件。当您运行 MoonBit 命令时,占位符可执行文件确定要使用哪个 MoonBit 工具链,并将命令代理到所需工具链中的实际 MoonBit 可执行文件。
使用这种方法,您可以在不同项目之间轻松切换 MoonBit 工具链,而无需更改 PATH。
MoonBit 发布
Moonup 从由 GitHub Actions 驱动的 chawyehsu/moonbit-binaries 下载 MoonBit 发布版本,并从官方网站持续存档 MoonBit 发布版本。
已知限制
- MoonBit 核心标准库的隔离存在问题,见 #7。
开发
先决条件:Git、Rust
# clone the repo
git clone https://github.com/chawyehsu/moonup
cd moonup
# build
cargo build
# run and test
cargo run -- help
0.1.0 路线图
- 一个
install
命令来安装多个 MoonBit 工具链 - 一个
pin
命令将工具链固定到项目的特定版本 - 创建占位符可执行文件以自动切换工具链
- 一个
default
命令来设置默认工具链 - 一个
show
命令显示已安装和当前活动工具链 - 一个
which
命令显示给定命令将运行的实际二进制文件 - 一个
run
命令使用特定工具链运行命令 - 一个
update
命令来自更新并更新工具链 - 一个
completions
命令生成 shell 补全
许可协议
moonup © Chawye Hsu。在Apache-2.0许可证下发布。
博客 · GitHub @chawyehsu · Twitter @chawyehsu
依赖项
~26–43MB
~697K SLoC