From b16ad26b00e55bd97789a2b98322c10003ac14ce Mon Sep 17 00:00:00 2001 From: welpo Date: Sat, 30 Dec 2023 01:07:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20chore(pre-commit):=20ignore=20TO?= =?UTF-8?q?DO=20in=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .githooks/pre-commit | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 7b8e234..8e028c1 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -151,10 +151,13 @@ fi # Get the newly added and modified files. all_changed_files=$(git diff --cached --name-only --diff-filter=AM) +script_name=$(basename "$0") # Loop through all newly added or modified files. for file in $all_changed_files; do - # Ignore this script. - if [[ "$file" == "$0" ]]; then + file_name=$(basename "$file") + + # Ignore this script and the changelog. + if [[ "$file_name" == "$script_name" ]] || [[ "$file_name" == "CHANGELOG.md" ]]; then continue fi