6个版本
0.1.6 | 2024年7月9日 |
---|---|
0.1.5 | 2024年7月1日 |
0.1.0 | 2017年8月26日 |
#980 在 解析器实现
1,388 每月下载次数
13KB
169 代码行
tq
此存储库之前可在 cryptaliagy/tq-rs
下使用,并由 crate tq-rs
提供。
当前版本的crate支持 tq
和 tomlq
二进制文件。 wherever possible, tq
应该优先使用,tomlq
将在 0.2.0
版本(预定于2025年1月1日发布)中从crate中删除。
安装
- 使用
cargo
(从源码编译):cargo install tomlq
- 使用
cargo-binstall
(从Github发布页面下载):cargo binstall -y tomlq
从 tq-rs
crate 迁移
从 tq-rs
迁移到 tomlq
所需的唯一步骤是将 cargo install
(或 cargo binstall
)步骤从引用 tq-rs
更改为引用 tomlq
。 二进制文件具有相同的名称,用法也相同。
用法
注意:安装后使用
tq --help
获取更多信息
从 Cargo.toml
获取包版本
tq -f Cargo.toml 'package.version'
在 Github Actions 中将包版本作为作业输出导出
jobs:
get-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cargo-binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Install tq
run: cargo binstall -y tomlq
- id: get-version
name: Output the current version of the project
run: echo "version=$(tq -f Cargo.toml 'package.version')" >> "$GITHUB_OUTPUT"
注意:有关如何使用此作业的信息,请参阅 发布管道文件。
贡献
欢迎贡献!我只需要这个功能,所以没有在这上面花费额外的时间。如果你有想法,请随时创建一个issue,如果你实现了额外的功能,请随时创建一个PR!
许可证
在MIT许可证下授权
依赖
~1–12MB
~88K SLoC