php-git-hooks icon indicating copy to clipboard operation
php-git-hooks copied to clipboard

Not find the commands inside bin

Open gfirem opened this issue 8 years ago • 8 comments
trafficstars

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

gfirem avatar Sep 10 '17 00:09 gfirem

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

danitome24 avatar Sep 11 '17 16:09 danitome24

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

gfirem avatar Sep 11 '17 17:09 gfirem

You have to put this config line in composer.json file, not in package.json

danitome24 avatar Sep 11 '17 17:09 danitome24

Sorry i refer to composer.json.

gfirem avatar Sep 11 '17 18:09 gfirem

Can you paste your error?

danitome24 avatar Sep 11 '17 18:09 danitome24

@gfirem it works in your project?.

bruli avatar Sep 20 '17 09:09 bruli

@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.

maxfontana90 avatar May 30 '18 01:05 maxfontana90

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.

maxfontana90 avatar May 30 '18 01:05 maxfontana90