From 2f149bc107decf55d0b7739f5659529b3d351b74 Mon Sep 17 00:00:00 2001 From: Shaun Keating Date: Wed, 22 May 2024 15:42:09 +0100 Subject: [PATCH 1/2] Add a `git_hooks_path` config variable that allows you to point the package to the correct path to place githooks for your project. This is useful if your project is a git submodule of a bigger project. --- config/git-hooks.php | 11 +++++++++++ src/GitHooks.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/git-hooks.php b/config/git-hooks.php index 47d4cb1..180f0b0 100644 --- a/config/git-hooks.php +++ b/config/git-hooks.php @@ -290,4 +290,15 @@ | */ 'debug_commands' => false, + + /* + |-------------------------------------------------------------------------- + | Git hooks path + |-------------------------------------------------------------------------- + | + | This configuration option allows you to configure where the git hooks + | are stored for this project, you might need to change this if you + | are using git submodules as part of a wider project. + */ + 'git_hooks_path' => base_path('.git'.DIRECTORY_SEPARATOR.'hooks'), ]; diff --git a/src/GitHooks.php b/src/GitHooks.php index 7e52bec..eeab6f2 100644 --- a/src/GitHooks.php +++ b/src/GitHooks.php @@ -84,6 +84,6 @@ public function getHookStub() */ public function getGitHooksDir() { - return base_path('.git'.DIRECTORY_SEPARATOR.'hooks'); + return config('git-hooks.git_hooks_path', base_path('.git'.DIRECTORY_SEPARATOR.'hooks')); } } From 69d6b15aa40a65556b0c3aee8f5d9a108e99b450 Mon Sep 17 00:00:00 2001 From: Shaun Keating Date: Thu, 23 May 2024 09:27:01 +0100 Subject: [PATCH 2/2] Fix the CI for Laravel 9 by adding `orchestra/testbench` `^v7` as an option in `composer.json`. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7853733..4380eab 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "laravel/pint": "^1.2", "mockery/mockery": "^1.5.1", "larastan/larastan": "^2.9", - "orchestra/testbench": "^v8.0.0|^v9.0.0", + "orchestra/testbench": "^v7.0.0|^v8.0.0|^v9.0.0", "pestphp/pest": "^2.0", "squizlabs/php_codesniffer": "^3.7" },