Skip to content

Commit 00e1464

Browse files
committed
chore: Add modified files to the commit
1 parent fac4a8a commit 00e1464

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

hooks/pre-commit

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,15 @@ if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then
44
exec < /dev/tty
55
fi
66

7-
$(pwd)/vendor/bin/pint
7+
$(pwd)/vendor/bin/pint $@
8+
# Get the list of files that were modified by Pint
9+
modified_files=$(git diff --name-only --cached)
10+
11+
# Add the modified files back to the staging area
12+
if [ -n "$modified_files" ]; then
13+
echo "Adding fixed files to the commit..."
14+
git add $modified_files
15+
fi
16+
17+
18+

0 commit comments

Comments
 (0)