-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-Authored-By: Daniel Coulbourne <[email protected]>
- Loading branch information
1 parent
ec0892f
commit 49983f3
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Move into project root | ||
BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
cd "$BIN_DIR" | ||
cd .. | ||
|
||
# Exit on errors | ||
set -e | ||
|
||
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '***.php') | ||
|
||
if [[ -z "$CHANGED_FILES" ]]; then | ||
echo 'No changed files' | ||
exit 0 | ||
fi | ||
|
||
if [[ -x vendor/bin/pint ]]; then | ||
vendor/bin/pint --dirty | ||
git add $CHANGED_FILES | ||
else | ||
echo 'pint is not installed' | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"disabled": [], | ||
"hooks": { | ||
"pre-commit": [ | ||
"composer format" | ||
"./bin/pre-commit.sh" | ||
] | ||
} | ||
} |