Skip to content

Commit 8f23118

Browse files
committedJan 4, 2016
A few improvements for untag.
[ci skip]
1 parent c530ede commit 8f23118

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed
 

‎scripts/tag.sh

+16-3
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,38 @@ function rbx_untag_release {
2323

2424
version=$1
2525

26+
if [[ -z $version ]]; then
27+
cat >&2 <<EOM
28+
untag VERSION is required
29+
30+
EOM
31+
rbx_tag_usage
32+
fi
33+
2634
IFS="." read -r -a array <<< "$(rbx_revision_version)"
2735

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

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

33-
git describe "$untag_version" > /dev/null
41+
git describe "v$untag_version"
3442

3543
if [[ $? -eq 0 && "$version" == "$untag_version" ]]; then
3644
echo Untagging "v$version"
37-
# git tag -d "v$version" && git push origin ":refs/tags/v$version"
45+
git tag -d "v$version" && git push origin ":refs/tags/v$version"
3846
else
3947
echo NOT untagging "v$version", does not match "v$untag_version"
4048
fi
4149
}
4250

4351
function rbx_tag_usage {
44-
echo "Usage: ${0##*/} [tag untag]"
52+
cat >&2 <<-EOM
53+
Usage: ${0##*/} option
54+
where option is
55+
tag Tags a release at the current release + 1
56+
untag VERSION Untags VERSION if it is the current release
57+
EOM
4558
exit 1
4659
}
4760

0 commit comments

Comments
 (0)
Please sign in to comment.