From a5061b5a343511f39ca55eea2ff090fbb444af2f Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Wed, 22 Apr 2020 20:08:17 -0300 Subject: [PATCH] trailing-newlines.sh should exit with error code 1 otherwise the script will not fail/stop. --- .github/scripts/trailing-newlines.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/scripts/trailing-newlines.sh b/.github/scripts/trailing-newlines.sh index ef17c5afd..e1170c0f1 100755 --- a/.github/scripts/trailing-newlines.sh +++ b/.github/scripts/trailing-newlines.sh @@ -4,7 +4,11 @@ set -eu -o pipefail ${SHELLFLAGS} # Checking version to force it fail the build if rg is not installed. # Because `set -e` does not work inside the subshell $() -rg --version > /dev/null 2>&1 || echo "Error: ripgrep is not installed!" +if ! rg --version > /dev/null 2>&1; +then + echo "Error: ripgrep is not installed!"; + exit 1; +fi; files=$(rg -l '[^\n]\z' -g '!*.{png,svg,scss,json,sql}' || true)