From 6f09fbff4e7fd1ab662c1cdad757ce44afc2eea2 Mon Sep 17 00:00:00 2001 From: Greg Hurrell <greg@hurrell.net> Date: Sat, 9 Aug 2014 13:53:52 -0700 Subject: [PATCH] Clean up website/publish.sh script Reduce noise by replacing the repeated `&&` chain with use of `set -e`, which will cause the script to bail on the first command that exits with a non-zero exit code. --- website/publish.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/website/publish.sh b/website/publish.sh index 811413aac951ad..9d6e979e86fdd5 100755 --- a/website/publish.sh +++ b/website/publish.sh @@ -1,20 +1,22 @@ #!/bin/bash +set -e + # Start in website/ even if run from root directory cd "$(dirname "$0")" -cd ../../flux-gh-pages && \ -git checkout -- . && \ -git clean -dfx && \ -git fetch && \ -git rebase && \ -rm -Rf * && \ -cd ../flux/website && \ -node server/generate.js && \ -cp -R build/flux/* ../../flux-gh-pages/ && \ -rm -Rf build/ && \ -cd ../../flux-gh-pages && \ -git add --all && \ -git commit -m "update website" && \ -git push && \ +cd ../../flux-gh-pages +git checkout -- . +git clean -dfx +git fetch +git rebase +rm -Rf * +cd ../flux/website +node server/generate.js +cp -R build/flux/* ../../flux-gh-pages/ +rm -Rf build/ +cd ../../flux-gh-pages +git add --all +git commit -m "update website" +git push cd ../flux/website