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." }