Skip to content

Commit f0d8c95

Browse files
authored
build: #5 pre-commit error when not php changed
1 parent b7eeddb commit f0d8c95

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/stubs/git-pre-commit

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
#!/bin/sh
22

3-
git diff --diff-filter=d --name-only HEAD | grep ".php$" | xargs ./vendor/bin/phpcs --standard=phpcs.xml
3+
files=$(git diff --diff-filter=d --name-only HEAD | grep ".php$")
4+
5+
if [ -n "$files" ] ; then
6+
./vendor/bin/phpcs --standard=phpcs.xml $files
7+
fi

0 commit comments

Comments
 (0)