File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,21 @@ if [[ $VERSION != $NPM_VERSION ]]; then
2121 exit 1
2222fi
2323
24- # Create a new git tag if they have not already done so
24+ # Ensure the checked out branch is master
25+ CHECKED_OUT_BRANCH=" $( git branch | grep " *" | awk -F ' ' ' {print $2}' ) "
26+ if [[ $CHECKED_OUT_BRANCH != " master" ]]; then
27+ echo " Error: Your firebase-tools repo is not on the master branch."
28+ exit 1
29+ fi
30+
31+ # Pull any changes to the firebase-tools repo
32+ git pull origin master
33+ if [[ $? -ne 0 ]]; then
34+ echo " Error: Failed to do git pull from firebase-tools repo."
35+ exit 1
36+ fi
37+
38+ # Create a git tag for the new version
2539LAST_GIT_TAG=" $( git tag --list | tail -1 | awk -F ' v' ' {print $2}' ) "
2640if [[ $VERSION != $LAST_GIT_TAG ]]; then
2741 git tag v$VERSION
@@ -30,8 +44,8 @@ if [[ $VERSION != $LAST_GIT_TAG ]]; then
3044 echo " *** Last commit tagged as v${VERSION} ***"
3145 echo
3246else
33- echo " *** Git tag v${VERSION} already created *** "
34- echo
47+ echo " Error: git tag v${VERSION} already exists. Make sure you are not releasing an already-released version. "
48+ exit 1
3549fi
3650
3751# Publish the new version to npm
You can’t perform that action at this time.
0 commit comments