From 0115100ca0a20b5d06d037c5ce83ca6556e807a3 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 2 Sep 2022 10:45:38 +0200 Subject: [PATCH] bugfix get_current_tag It fails on (HEAD, tag: live-20220830-2) and succeeds on (HEAD, tag: live-20220901-1, origin/live) small patch to the grep and sed to not require a comma at the end of the tag name. --- bin/check_git | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check_git b/bin/check_git index bc4e199..cc14366 100755 --- a/bin/check_git +++ b/bin/check_git @@ -496,7 +496,7 @@ get_current_branch() { get_current_tag() { _path="${1}" - _tag="$( run "cd ${_path} && git log --pretty=format:'%d' --abbrev-commit --date=short -1 | grep -Eo 'tag:.*?,' | sed 's/,.*$//g' | sed 's/tag:[[:space:]]*//g'" )" + _tag="$( run "cd ${_path} && git log --pretty=format:'%d' --abbrev-commit --date=short -1 | grep -Eo 'tag:.*?[,)]' | sed 's/[,)].*$//g' | sed 's/tag:[[:space:]]*//g'" )" if [ "${_tag}" = "" ]; then echo return 1