From 1eaa2d7fb9a69c344997a1cb7dd6640376a535da Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 31 Mar 2024 20:06:51 +0200 Subject: [PATCH] pack.sh: extract version from Cargo.toml --- doc/scripts/pack.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/scripts/pack.sh b/doc/scripts/pack.sh index 9df5e9a..7d6182f 100755 --- a/doc/scripts/pack.sh +++ b/doc/scripts/pack.sh @@ -4,7 +4,10 @@ set -e -VERSION=0.4.0 +VERSION="$(sed -nr 's/^\s*version\s*=\s*"(.*)"\s*$/\1/p' Cargo.toml)" +test -z "$VERSION" && echo 'Error: Could not extract version from Cargo.toml' && exit +echo "Extracted version from Cargo.toml: $VERSION" + TMPPATH=ZIP_TMP_PATH mkdir "$TMPPATH" cd "$TMPPATH"