Package developed to automate and change the main folder referring to git hooks.
Add private repository in composer json file:
{
...
"repositories": [
{
"type": "vcs",
"url": "[email protected]:atlastechnol/package-laravel-git-hooks.git"
}
]
}
Require this package with composer:
composer require --dev rsgabrielrm/laravel-git-hooks
You can install the package:
php artisan laravel-git-hooks:install
Change the pre-commit template file created in .gitHooks/
and add the action you want to take before the user successfully commits.
Example if you are using docker:
#!/bin/sh
. "$(dirname "$0")/_/hooks.sh"
cd ..
containerName='enter-the-container-name'
docker-compose up --detach --no-deps --no-recreate ${containerName}
docker-compose exec -T ${containerName} php artisan test
You can use other git hooks as per the documentation.
This package was inspired by the npm husky package.
Package created by Gabriel Menezes.