From bebe9299860f04799d7ada54ba065cad1b0e18f8 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Wed, 1 May 2019 18:30:02 +0300 Subject: [PATCH] Terminate shell scripts if any subcomand terminated --- resources/checkgit.sh | 3 +++ resources/gitpublish.sh | 3 +++ resources/prepublish.sh | 3 +++ 3 files changed, 9 insertions(+) diff --git a/resources/checkgit.sh b/resources/checkgit.sh index f6798e23d4..6555a93f66 100644 --- a/resources/checkgit.sh +++ b/resources/checkgit.sh @@ -1,3 +1,6 @@ +# Exit immediately if any subcommand terminated +trap "exit 1" TERM + # # This script determines if current git state is the up to date master. If so # it exits normally. If not it prompts for an explicit continue. This script diff --git a/resources/gitpublish.sh b/resources/gitpublish.sh index f1b3b7ac1c..67d0c6f592 100644 --- a/resources/gitpublish.sh +++ b/resources/gitpublish.sh @@ -1,5 +1,8 @@ #!/bin/sh -e +# Exit immediately if any subcommand terminated +trap "exit 1" TERM + # This script maintains a git branch which mirrors master but in a form that # what will eventually be deployed to npm, allowing npm dependencies to use: # diff --git a/resources/prepublish.sh b/resources/prepublish.sh index 933d406dc8..2c4983d3bb 100644 --- a/resources/prepublish.sh +++ b/resources/prepublish.sh @@ -1,3 +1,6 @@ +# Exit immediately if any subcommand terminated +trap "exit 1" TERM + # Publishing to NPM is currently supported by Travis CI, which ensures that all # tests pass first and the deployed module contains the correct file structure. # In order to prevent inadvertently circumventing this, we ensure that a CI