Add set -eu and failure messages in ./build.sh(s).

This commit is contained in:
Eddie Antonio Santos 2019-10-02 08:45:44 -06:00
parent f2f511840e
commit 00ccc0080f
No known key found for this signature in database
GPG key ID: DD411EA4D9509D87
2 changed files with 5 additions and 2 deletions

View file

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

View file

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