build(release): exit if proposed version exists on remote
MODIFY
script/release
script/release
#!/usr/bin/env bash
+fetch() {
+ git fetch --all
+}
+
+tag_exists_on_remote() {
+ git rev-parse --quiet --verify refs/tags/v$1.$2.$3 > /dev/null
+}
+
working_tree_is_clean() {
status=$(git status --porcelain)
[ "$status" == "" ]
@@ -76,6 +84,7 @@ main() {
echo "Prerequisite Checks"
echo "==================="
+ fetch
if ! working_tree_is_clean; then
echo "Error: unclean working tree"
exit 1
@@ -106,6 +115,11 @@ main() {
echo new version $major $minor $patch
+ if tag_exists_on_remote $major $minor $patch; then
+ echo "Error: tag exists on remote"
+ exit 1
+ fi
+
create_release_branch
update_readme $major $minor $patch
update_ruby_version $major $minor $patch

build(release): exit if proposed version exists on remote