* +wordl-rs

* fix ci?
This commit is contained in:
Jacob Heider 2024-02-02 16:01:49 -05:00 committed by GitHub
parent 898560d675
commit e67dc85a4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 0 deletions

View file

@ -25,6 +25,8 @@ jobs:
PATTERNS: projects/**/package.yml PATTERNS: projects/**/package.yml
- name: process diff - name: process diff
id: process-diff id: process-diff
env:
PKGX_PANTRY_PATH: ${{ github.workspace }}
run: | run: |
if [ -n "${{ steps.get-diff.outputs.diff }}" ]; then if [ -n "${{ steps.get-diff.outputs.diff }}" ]; then
for x in ${{ steps.get-diff.outputs.diff }}; do for x in ${{ steps.get-diff.outputs.diff }}; do

View file

@ -0,0 +1,15 @@
diff --git a/src/main.rs b/src/main.rs
index f21aebd..f7f8410 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,6 +15,10 @@ pub mod wordle;
#[tokio::main]
async fn main() -> color_eyre::Result<()> {
+ if std::env::args().any(|arg| arg == "--version" || arg == "-V") {
+ println!("wordl {}", env!("CARGO_PKG_VERSION"));
+ return Ok(());
+ }
color_eyre::install()?;
let result = run().await;
result?;

View file

@ -0,0 +1,21 @@
distributable:
url: https://github.com/palerdot/wordl-rs/archive/refs/tags/v{{ version }}.tar.gz
strip-components: 1
provides:
- bin/wordl
versions:
github: palerdot/wordl-rs
strip: /v/
build:
dependencies:
rust-lang.org: '>=1.56'
rust-lang.org/cargo: '*'
script:
# add --version/-V to allow a simple test
- patch -p1 < props/add-version.patch
- cargo install --locked --path . --root {{prefix}}
test: test "$(wordl --version)" = "wordl {{version}}"