From ce7cd4597404cf63edd9eec6a4b9675832e7e580 Mon Sep 17 00:00:00 2001 From: Robert von Burg Date: Mon, 2 Mar 2015 14:14:14 +0100 Subject: [PATCH] [Minor] added validating using SSH for pushing before releasing --- li.strolch.dev/release.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/li.strolch.dev/release.sh b/li.strolch.dev/release.sh index c17cffa6d..656aa8e19 100755 --- a/li.strolch.dev/release.sh +++ b/li.strolch.dev/release.sh @@ -56,11 +56,19 @@ if [ -z "${r}" ] || [ -z "${b}" ] || [ -z "${o}" ] || [ -z "${n}" ] ; then usage fi +# validate no uncommitted changes if [ "$(git status --short)" != "" ] ; then - echo "You have uncommitted changes!" + echo -e "ERROR: You have uncommitted changes! Please commit them before continuing." exit 1 fi +# First make sure we use SSH for pushing +if find .git/modules -type f -name config | xargs grep "https://github.com" ; then + echo -e "ERROR: There is at least one submodule which has its remote set to https://github.com" + echo -e "ERROR: Please change this before your continuing, using the following command:" + echo -e " find .git/modules -type f -name config | xargs sed -i .bck \"s|https://github.com/|git@github.com:|g\"" + exit 1 +fi # set vars create_release_branch="${c}"