php-git-hooks
php-git-hooks copied to clipboard
Not find the commands inside bin
Hi i love your project. Is not working for me. I set the bin config in the json but it don't find the folder inside vendor/bin. I remove and is the same error. Exist some place where i can read more about the issue?
i always get the next error message.
Could not open input file: bin/jsonlint and if i disable Could not open input file: bin/phpunit or if i enable composer it throw other Composer files not found
Have you added this to composer.json?:
"config": {
"bin-dir": "bin"
}
Have you typed composer install after that?
Try to create bin dir if it does not exists and run it again
I do it. I put to bin also to vendor/bin in my project i already have a bin folder with a script for unit test. When i put that config in the package.json it throw an error. Thanks for your help i want to make it work
You have to put this config line in composer.json file, not in package.json
Sorry i refer to composer.json.
Can you paste your error?
@gfirem it works in your project?.
@bruli I just pulled your project as a dependency into my application and I'm experiencing the same issue as @gfirem. I see in the console that its complaining about not locating the binaries.
Dump:
Pre-Commit tool
Running PHPLINT...................................0K
Checking code style with PHPCS....................
Fail
Could not open input file: bin/phpcs
I found where the issue is and the problem is here:
https://github.com/bruli/php-git-hooks/blob/ef4c6ec6b3209c8083d0bd20c14064e59c96aa0f/src/PhpGitHooks/Infrastructure/Tool/ToolPathFinder.php#L38
Its missing the vendor/ prefix.
Also looks like you wanted to bootstrap the composer/installed.json file and populate the installedPackages array to search for the binaries inside the package's folder but didn't finish the task.
Its worth to mention that specifying the bin dir in composer.json isn't working for me right now, so I guess that is the problem. I still see the binaries inside vendor/bin.