Clean up sync script

This commit is contained in:
Brandon Keepers
2017-09-09 12:13:44 -05:00
parent 2e6659768d
commit 286e003c0c

View File

@@ -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
}