Skip to content

Commit fac4a8a

Browse files
committed
hooks?
1 parent 2841675 commit fac4a8a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@
8484
"@php artisan vendor:publish --tag=laravel-assets --ansi --force",
8585
"Illuminate\\Foundation\\ComposerScripts::postUpdate"
8686
],
87-
"post-install-cmd": [],
87+
"post-install-cmd": [
88+
"cp -r 'hooks/' '.git/hooks/'",
89+
"php -r \"copy('hooks/pre-commit', '.git/hooks/pre-commit');\"",
90+
"php -r \"chmod('.git/hooks/pre-commit', 0777);\""
91+
],
8892
"post-root-package-install": [
8993
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
9094
],

hooks/pre-commit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# Detect whether /dev/tty is available & functional
3+
if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then
4+
exec < /dev/tty
5+
fi
6+
7+
$(pwd)/vendor/bin/pint

0 commit comments

Comments
 (0)