igorsgm / laravel-git-hooks

🪝 • Efficiently manage Git hooks in Laravel projects. Enhance code quality, save time on reviews, and prevent bugs from entering your repository.
MIT License
23 stars 6 forks source link

Problem with PrepareCommitMessage arguments #36

Open mariomeyer opened 2 weeks ago

mariomeyer commented 2 weeks ago

Right now the src/Console/Commands/stubs/hook file is creating all hooks in .git/hooks calling:

php {artisanPath} {command} $@ >&2

This is passing all the files to the command.

But command git-hooks:prepare-commit-message only receives file which is the commit message file. Thus it's failing by default.

It works though changing that hook to:

php {artisanPath} {command} $1 >&2

Which passes only the commit message file.

Rasmus-Bertell commented 3 days ago

This should be fixed by #34 if it ever gets merged.