From 3a142f4b279998a7d4fb707562496811a37d30af Mon Sep 17 00:00:00 2001 From: Andre Maroneze <andre.maroneze@cea.fr> Date: Fri, 15 Jan 2021 14:29:31 +0100 Subject: [PATCH] [Dev] avoid Bash 4 feature for macOS better compatibility --- bin/check_newline.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/bin/check_newline.sh b/bin/check_newline.sh index 478208eb63e..c91311fb289 100755 --- a/bin/check_newline.sh +++ b/bin/check_newline.sh @@ -16,9 +16,6 @@ is_likely_text_file() { esac } -declare -A exceptions -exceptions=(["VERSION"]=1 ["VERSION_CODENAME"]=1) - errors=0 IFS='' @@ -27,11 +24,9 @@ while read file do if [ -n "$(is_likely_text_file "$file")" ]; then x=$(tail -c 1 "$file") - if [ "$x" != "" ]; then - if [ ! ${exceptions["$file"]+x} ]; then - echo "error: no newline at end of file: $file" - errors=$((errors+1)) - fi + if [ "$x" != "" -a "$file" != "VERSION" -a "$file" != "VERSION_CODENAME" ]; then + echo "error: no newline at end of file: $file" + errors=$((errors+1)) fi fi done -- GitLab