Skip to content

Commit

Permalink
Merge pull request #76 from bartfeenstra/release-exit-on-error
Browse files Browse the repository at this point in the history
Make the relase command exit immediately on any error.
  • Loading branch information
bartfeenstra committed Jun 23, 2018
2 parents 43dad50 + a930bac commit e455850
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/release
@@ -1,6 +1,8 @@
#! /usr/bin/env bash


set -e

cd `dirname "$0"`/..

if [ "$#" -ne 1 ]
Expand All @@ -19,15 +21,13 @@ if [[ ! $VERSION =~ ^[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}$ ]]; then
fi

# Check this version does not already exist.
git tag | grep -q ^$VERSION$
if [ $? -eq 0 ]; then
if git tag | grep -q ^$VERSION$; then
echo "Version $VERSION already exists."
exit 1
fi

# Check there are no uncommitted changes.
git diff-index --quiet HEAD --
if [ $? -ne 0 ]; then
if ! git diff-index --quiet HEAD --; then
echo 'The Git repository has uncommitted changes.'
exit 1
fi
Expand Down

0 comments on commit e455850

Please sign in to comment.