From cc4f4cb56c220166ec693e59f36629ed6c5a099b Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Wed, 5 Oct 2022 08:54:11 +0700 Subject: [PATCH 1/2] chore(common): builder script maintenance --- .../{build-utils.test.sh => tests/builder.inc.test.sh} | 8 ++++---- resources/builder.inc.sh | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) rename resources/build/{build-utils.test.sh => tests/builder.inc.test.sh} (96%) mode change 100755 => 100644 diff --git a/resources/build/build-utils.test.sh b/resources/build/tests/builder.inc.test.sh old mode 100755 new mode 100644 similarity index 96% rename from resources/build/build-utils.test.sh rename to resources/build/tests/builder.inc.test.sh index b689fa0ff4..4fccb2a072 --- a/resources/build/build-utils.test.sh +++ b/resources/build/tests/builder.inc.test.sh @@ -5,7 +5,7 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/build-utils.sh" +. "$(dirname "$THIS_SCRIPT")/../build-utils.sh" # END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -164,9 +164,9 @@ fi # Due to the nature of the build-utils-traps tests, only one may be # specified at a time; each ends with an `exit`. echo "Running separate tests" -$THIS_SCRIPT_PATH/tests/build-utils-traps.test.sh error -$THIS_SCRIPT_PATH/tests/build-utils-traps.test.sh error-in-function -$THIS_SCRIPT_PATH/tests/build-utils-traps.test.sh incomplete +$THIS_SCRIPT_PATH/build-utils-traps.test.sh error +$THIS_SCRIPT_PATH/build-utils-traps.test.sh error-in-function +$THIS_SCRIPT_PATH/build-utils-traps.test.sh incomplete echo "Fin" # Finally, run with --help so we can see what it looks like diff --git a/resources/builder.inc.sh b/resources/builder.inc.sh index 81c1d3cedd..b6137ec3b0 100755 --- a/resources/builder.inc.sh +++ b/resources/builder.inc.sh @@ -7,9 +7,9 @@ # * THIS_SCRIPT_PATH defines the full path of the running script # * THIS_SCRIPT_NAME defines the basename of the running script # * THIS_SCRIPT_IDENTIFIER defines the repo-relative path of the running script -# * _builder_ functions and variables are internal use only for builder.inc.sh, and +# * _builder_ functions and variables are internal use only for builder.inc.sh, and # subject to change at any time. Do not use them in other scripts. -# * Note: the running script is the top-level script that includes either +# * Note: the running script is the top-level script that includes either # builder.inc.sh directly, or, just in the Keyman repo, via build-utils.sh. # @@ -188,6 +188,11 @@ _builder_failure_trap() { fi builder_finish_action failure $action $target + + # Make 100% sure that the exit code chains fully. + # Without this, nested scripts have failed to chain errors from npm calls past the script + # that directly executed the failed npm command. + exit $trappedExitCode fi } From 7f60cdab71333c5bbebf7a1407fa28412a7194c7 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Wed, 5 Oct 2022 14:33:07 +0700 Subject: [PATCH 2/2] fix(common): builder unit-test script chmod+x --- resources/build/tests/builder.inc.test.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 resources/build/tests/builder.inc.test.sh diff --git a/resources/build/tests/builder.inc.test.sh b/resources/build/tests/builder.inc.test.sh old mode 100644 new mode 100755