Skip to content

Commit

Permalink
A few improvements for untag.
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
brixen committed Jan 4, 2016
1 parent c530ede commit 8f23118
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions scripts/tag.sh
Expand Up @@ -23,25 +23,38 @@ function rbx_untag_release {

version=$1

if [[ -z $version ]]; then
cat >&2 <<EOM
untag VERSION is required
EOM
rbx_tag_usage
fi

IFS="." read -r -a array <<< "$(rbx_revision_version)"

let major=${array[0]}
let minor=${array[1]}

untag_version="${major}.${minor}"

git describe "$untag_version" > /dev/null
git describe "v$untag_version"

if [[ $? -eq 0 && "$version" == "$untag_version" ]]; then
echo Untagging "v$version"
# git tag -d "v$version" && git push origin ":refs/tags/v$version"
git tag -d "v$version" && git push origin ":refs/tags/v$version"
else
echo NOT untagging "v$version", does not match "v$untag_version"
fi
}

function rbx_tag_usage {
echo "Usage: ${0##*/} [tag untag]"
cat >&2 <<-EOM
Usage: ${0##*/} option
where option is
tag Tags a release at the current release + 1
untag VERSION Untags VERSION if it is the current release
EOM
exit 1
}

Expand Down

0 comments on commit 8f23118

Please sign in to comment.