From 67cdcedd4ecf2614586a90e4251eb9f0309da0cc Mon Sep 17 00:00:00 2001 From: trestletech Date: Wed, 19 Jun 2019 11:04:39 -0500 Subject: [PATCH] Better bash --- tools/checkDocsCurrent.sh | 11 +++-------- tools/checkJSCurrent.sh | 11 +++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/tools/checkDocsCurrent.sh b/tools/checkDocsCurrent.sh index 6d42068d1..1cc879db8 100755 --- a/tools/checkDocsCurrent.sh +++ b/tools/checkDocsCurrent.sh @@ -1,16 +1,11 @@ #!/bin/bash +set -e + # Generate package docs in the working directory Rscript -e "devtools::document(roclets=c('rd', 'collate', 'namespace'))" -if [ $? -ne 0 ] -then - echo "Error generating Roxygen docs." - exit 1 -fi -# This command will return a zero exit code if there are uncommitted changes -test -n "$(git status --porcelain)" -if [ $? -eq 0 ] +if [ -n "$(git status --porcelain)" ] then git status --porcelain echo "Please generate the Roxygen documentation and commit the updates." diff --git a/tools/checkJSCurrent.sh b/tools/checkJSCurrent.sh index 8acc82e9b..0f358ccc6 100755 --- a/tools/checkJSCurrent.sh +++ b/tools/checkJSCurrent.sh @@ -1,16 +1,11 @@ #!/bin/bash +set -e + # Run JS build process (cd "$(dirname "$0")" && yarn && yarn build) -if [ $? -ne 0 ] -then - echo "Error generating JavaScript assets with yarn." - exit 1 -fi -# This command will return a zero exit code if there are uncommitted changes -test -n "$(git status --porcelain)" -if [ $? -eq 0 ] +if [ -n "$(git status --porcelain)" ] then git status --porcelain echo "Please rebuild the JavaScript and commit the changes."