From 2043556dc53c40279c3c8355cb97f06fd10d2d99 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 24 Jul 2017 20:06:06 +0100 Subject: [PATCH] Exit if no changes --- publish.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/publish.sh b/publish.sh index b42632691..9abccf3b6 100755 --- a/publish.sh +++ b/publish.sh @@ -18,6 +18,13 @@ vendor/bin/sculpin generate --no-interaction --clean --env=${SITE_ENV} touch output_${SITE_ENV}/.nojekyll mv output_${SITE_ENV} docs +git config --local user.email "oliver@oliver@oliverdavies.uk" + +if [ -z `git diff --exit-code` ]; then + echo "No changes on this push. Exiting." + exit 0 +fi + # Add, commit and push the changes. git checkout $TARGET_BRANCH git add --all docs