From 008e64402461831b25128d8104de5021884d4877 Mon Sep 17 00:00:00 2001 From: shimun Date: Thu, 3 Sep 2020 14:56:22 +0200 Subject: [PATCH] auto detect current version --- PKGBUILD | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PKGBUILD b/PKGBUILD index c7ac4da..ac50d70 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -9,6 +9,12 @@ pkgdesc="Decrypt your LUKS partition using a FIDO2 compatible authenticator" url="https://github.com/shimunn/fido2luks" license=('MPL-2.0') +pkgver() { + # Use tag version if possible otherwise concat project version and git ref + git describe --exact-match --tags HEAD 2> /dev/null || \ + echo "$(cargo pkgid | cut -d'#' -f2).$(git describe --always)" +} + build() { cargo build --release --locked --all-features --target-dir=target ./target/release/fido2luks completions bash target