Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new method ::getVendorBin() #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gheydon
Copy link

@gheydon gheydon commented May 30, 2023

As part of this change I investigated a few projects to see how they are doing this such as upgrade status and upgrade rector and they both have something similar to this but both do it in different ways.

I think this is the definitive method of determining the vendor bin and gives a centralised method of accessing this information so many projects doing have to add it themselves.

One minor issue i found this this is that in my clients config the config.bin-dir is set to bin/ which means that when the vendor dir is returned it has the trailing /. so when you do something like

$bin = $drupalFinder->getVendorDir() . '/rector';

you will get /composer_root/bin//rector. this is ok, but a little messy. But I am also assuming it you set config.vendor-dir to something like 'vendor-here/' then the same issue will happen.

@davereid
Copy link

I will note that the docs for the vendor-bin config don't include a trailing slash:

Defaults to vendor/bin.

https://getcomposer.org/doc/06-config.md#bin-dir

@weitzman
Copy link
Collaborator

Until this project adds it, use the Composer API for this - https://getcomposer.org/doc/07-runtime.md#binary-bin-dir-path-in-binaries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants