feat(NA): add trap for SIGINT in the git precommit hook (#52662)

This commit is contained in:
Tiago Costa 2019-12-10 22:05:19 +00:00 committed by GitHub
parent 6e476e845d
commit 0eb4c18fe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,6 +58,15 @@ function getKbnPrecommitGitHookScript(rootPath, nodeHome, platform) {
set -euo pipefail
# Make it possible to terminate pre commit hook
# using ctrl-c so nothing else would happen or be
# sent to the output.
#
# The correct exit code on that situation
# according the linux documentation project is 130
# https://www.tldp.org/LDP/abs/html/exitcodes.html
trap "exit 130" SIGINT
has_node() {
command -v node >/dev/null 2>&1
}