diff --git a/script/remote-sync b/script/remote-sync index 0a93ffa..b43a459 100755 --- a/script/remote-sync +++ b/script/remote-sync @@ -1,9 +1,7 @@ #!/usr/bin/env bash # Run script/sync-data and push changes. -set -x # print commands before execution -set -o errexit # always exit on error -set -o pipefail # honor exit codes when piping +set -e echo "===> Syncing data" script/sync-data @@ -14,9 +12,10 @@ git diff --quiet || { REPO=`git config remote.origin.url` + # If GH_TOKEN environment variable is present, use that to push. if [[ -n "$GH_TOKEN" ]]; then REPO=${REPO/https:\/\//https://${GH_TOKEN}@} fi - git push $REPO HEAD:$TRAVIS_BRANCH + git push $REPO HEAD:master }