Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 1.14 KB

README.md

File metadata and controls

50 lines (38 loc) · 1.14 KB

Laravel Git Hooks

Package developed to automate and change the main folder referring to git hooks.

Installation

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

Usage

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.

Credits

This package was inspired by the npm husky package.

Package created by Gabriel Menezes.