From 5c35459a1876d4c121cca1609e7f5c39a4abb12c Mon Sep 17 00:00:00 2001 From: Philipp Date: Fri, 7 Jan 2022 00:03:05 +0100 Subject: [PATCH] Fix license_check --- php-cs/check-license.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/php-cs/check-license.sh b/php-cs/check-license.sh index 7afe405..e381cb4 100755 --- a/php-cs/check-license.sh +++ b/php-cs/check-license.sh @@ -5,13 +5,17 @@ [[ -z "${CHANGED_FILES}" ]] && exit 0 +IFS=' ' read -ra files <<<"${CHANGED_FILES//$'\n'/ }" + current_year=$(date +"%Y") php_template_md5=$(sed "s/%%YEAR%%/$current_year/g" "mods/license/license_php.template" | md5sum) php_template_rows=$(wc -l "mods/license/license_php.template" | cut -d" " -f1) exitVal=0 -for file in "${CHANGED_FILES[@]}"; do +printf "\n" + +for file in "${files[@]}"; do php_license_md5=$(head -n "$php_template_rows" "$file" | md5sum) [[ "$php_template_md5" != "$php_license_md5" ]] && printf " - %s\n" "$file" && exitVal=1 done