From fc846211b7c5929dc875926879c95be1484d8cd8 Mon Sep 17 00:00:00 2001 From: Andrea Maria Piana Date: Wed, 10 Apr 2024 12:18:30 +0100 Subject: [PATCH] fix_: make sure tag version works if no args are passed --- _assets/scripts/tag_version.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_assets/scripts/tag_version.sh b/_assets/scripts/tag_version.sh index b3025b2a3..ed34f2eb6 100644 --- a/_assets/scripts/tag_version.sh +++ b/_assets/scripts/tag_version.sh @@ -41,11 +41,12 @@ calculate_new_version() { main() { - target_commit=${1:-HEAD} - new_version=$(calculate_new_version "$target_commit") + new_version=$(calculate_new_version "$1") echo "calculated new version: $new_version" >&2 - git tag -a "$new_version" "$target_commit" -m "release $target_commit" + git tag -a "$new_version" "$1" -m "release $new_version" } -main "$1" +target_commit=${1:-HEAD} + +main "$target_commit"