Skip to content

Commit

Permalink
fix(git): improve -m options
Browse files Browse the repository at this point in the history
  • Loading branch information
mgred committed Feb 6, 2024
1 parent f5b2172 commit 8608bf6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions git/tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ _PUSH_CHANGES=0
_VERBOSE=0
_TAG=""
_DO="create"
_GIT_TAG_ARGS=""
_MESSAGE=""

while [ $# -ne 0 ]; do
case $1 in
-h|--help) _print_help;;
-m|--message) _GIT_TAG_ARGS="$1 $2"; shift;;
-m|--message) _MESSAGE="$2"; shift;;
-p|--push) _PUSH_CHANGES=1;;
-u|--update) git fetch --tags;;
-v|--verbose) _VERBOSE=1;;
Expand All @@ -74,7 +74,11 @@ cd "$BUILD_WORKING_DIRECTORY"
case $_DO in
create)
_log "Create tag $_TAG"
git tag -a "$_TAG" "$_GIT_TAG_ARGS"
if [ "$_MESSAGE" != "" ]; then
git tag -a "$_TAG" -m "$_MESSAGE"
else
git tag -a "$_TAG"
fi

if [ $_PUSH_CHANGES -eq 1 ]; then
_log "Push changes"
Expand Down

0 comments on commit 8608bf6

Please sign in to comment.