From 00ccc0080fcd3d1ef0fa01eaf306d3eaa9590848 Mon Sep 17 00:00:00 2001 From: Eddie Antonio Santos Date: Wed, 2 Oct 2019 08:45:44 -0600 Subject: [PATCH] Add set -eu and failure messages in ./build.sh(s). --- common/predictive-text/build.sh | 5 ++++- developer/js/build.sh | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/common/predictive-text/build.sh b/common/predictive-text/build.sh index 5f032f67b1..e100dcf479 100755 --- a/common/predictive-text/build.sh +++ b/common/predictive-text/build.sh @@ -4,6 +4,9 @@ # Designed for optimal compatibility with the Keyman Suite. # +# Exit on command failure and when using unset variables: +set -eu + # Include some helper functions from resources . ../../resources/shellHelperFunctions.sh @@ -19,7 +22,7 @@ LEXICAL_MODELS_TYPES=../lexical-model-types # Build the worker and the main script. build ( ) { # Ensure that the local npm package we need can be require()'d. - (cd $LEXICAL_MODELS_TYPES && npm link .) + (cd $LEXICAL_MODELS_TYPES && npm link .) || fail "Could not link lexical-model-types" # Ensure that the build-product destination for any generated include .d.ts files exists. if ! [ -d $INCLUDES_OUTPUT ]; then diff --git a/developer/js/build.sh b/developer/js/build.sh index f57f702c13..990d8b1845 100755 --- a/developer/js/build.sh +++ b/developer/js/build.sh @@ -17,7 +17,7 @@ LEXICAL_MODELS_TYPES=../../common/lexical-model-types # Build the main script. build () { # Ensure that the local npm package can be require()'d. - (cd $LEXICAL_MODELS_TYPES && npm link .) + (cd $LEXICAL_MODELS_TYPES && npm link .) || fail "Could not link lexical-model-types" npm run build || fail "Could not build top-level JavaScript file." }