From 9618e23238e91a937471977adeb74db6f728c001 Mon Sep 17 00:00:00 2001 From: Travis Reeder Date: Sat, 27 May 2017 10:19:40 -0700 Subject: [PATCH] Now makes sure the tree is clean so it won't push anything you aren't expecting. --- release.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/release.sh b/release.sh index a441f325c..04b6a5e4e 100755 --- a/release.sh +++ b/release.sh @@ -4,8 +4,20 @@ set -ex user="treeder" service="functions" tag="latest" -version_file="api/version/version.go" +# ensure working dir is clean +git status +if [[ -z $(git status -s) ]] +then + echo "tree is clean" +else + echo "tree is dirty, please commit changes before running this" + exit 1 +fi + +git pull + +version_file="api/version/version.go" if [ -z $(grep -m1 -Eo "[0-9]+\.[0-9]+\.[0-9]+" $version_file) ]; then echo "did not find semantic version in $version_file" exit 1