add --version flag

This commit is contained in:
2025-08-26 00:07:59 +02:00
parent ad582caa5b
commit e83a9f3f51
4 changed files with 35 additions and 4 deletions

View File

@@ -1,5 +1,12 @@
#!/bin/sh
rm webTemplate-*
version="$(cat Cargo.toml | grep '^version' | sed -e 's/^.*"\([^"]*\)".*$/\1/')"
commit="$(git show --oneline -s | sed -e 's/ .*$//')"
dirty="$(test "$(git diff --shortstat 2> /dev/null | tail -n1)" == "" || echo -n "_drity" )"
echo "pub const VERSION: &'static str = \"${version} (${commit}${dirty})\";" >src/version.rs
cross build --target aarch64-unknown-linux-gnu --release
cargo build --release