Skip to content
Permalink
Browse files
A few improvements for untag.
[ci skip]
  • Loading branch information
brixen committed Jan 4, 2016
1 parent c530ede commit 8f231184d7a1cfa890207eac0bc95431c29f89a9
Showing with 16 additions and 3 deletions.
  1. +16 −3 scripts/tag.sh
@@ -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
}

0 comments on commit 8f23118

Please sign in to comment.