From 00e146418507ccd40bd4d6bd41d533e649062fb1 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 23 Sep 2024 20:48:57 +0200 Subject: [PATCH] chore: Add modified files to the commit --- hooks/pre-commit | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hooks/pre-commit b/hooks/pre-commit index f5fa60755..b19949d1a 100644 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -4,4 +4,15 @@ if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec < /dev/tty fi -$(pwd)/vendor/bin/pint +$(pwd)/vendor/bin/pint $@ +# Get the list of files that were modified by Pint +modified_files=$(git diff --name-only --cached) + +# Add the modified files back to the staging area +if [ -n "$modified_files" ]; then + echo "Adding fixed files to the commit..." + git add $modified_files +fi + + +