Skip to content

Conversation

@webflo
Copy link
Member

@webflo webflo commented Aug 8, 2015

I would like to add bin to the project template for binaries.

ping @pfrenssen, @yched, @greg-1-anderson

@webflo webflo changed the title Use bin for symlinked binaries Use bin/ for symlinked binaries Aug 8, 2015
@derhasi
Copy link
Member

derhasi commented Aug 8, 2015

I would expect bin to only contain project specific commands, as therefore I personally would go with the default composer behaviour in vendor/bin for third party commands.

@greg-1-anderson
Copy link
Collaborator

I usually set "bin-dir": "bin" for convenience, and put project-specific scripts in scripts. For example, I do this with all of my projects based on pantheon-systems/ci-scripts, including patheon-systems/example-drupal8-circle-composer, which is based on this project, but adds behat testing on Circle CI and a Pantheon deploy step.

I kind of like it this way (with bin at the root), and I have also seen other projects do this. However, I also add ./vendor/bin to my $PATH by default, so that I can run third-party commands easily when my cwd is at a project root, so the default location isn't really less convenient--unless the project in question also relocates the vendor directory -- which I need to do in my example Drupal Composer projects order to deploy it to Pantheon.

For this project, I don't feel strongly about where bin should go.

@webflo webflo closed this Oct 5, 2015
@webflo webflo deleted the bin-dir branch October 8, 2015 07:49
@bojanz
Copy link
Contributor

bojanz commented Sep 5, 2016

I was just about to suggest the same thing, why was this issue closed?

@greg-1-anderson
Copy link
Collaborator

This year I feel a little more strongly than last year that it is better to use the standard location, vendor/bin, unless the vendor directory is relocated.

One reason to keep the standard location is that php executables need to search for the vendor directory that they are associated with. Most apps do tend to search for ../vendor, but any that presumed they would always be in vendor/bin might not find their autoloader if bin is relocated.

I don't really know that this is a problem, and it is really a problem of composer, that allows for bin directory relocation without providing clear guidance on where it can go, and how applications should identify their autoloader location. All the same, I think it's best for this project to default to the standard location; folks can always relocate the bin directory themselves if that's what they want.

@bojanz
Copy link
Contributor

bojanz commented Sep 6, 2016

I've changed the drupalcommerce/project-base bin-dir to 'bin/', will see if it bites me.

@greg-1-anderson
Copy link
Collaborator

@bojanz: I have done this lots, and never been bitten. The objection is mostly theoretical.

@webflo
Copy link
Member Author

webflo commented Sep 6, 2016

Yeah both things work, but composer does not change the location of the binaries if you change it in the middle of the project. You have to reinstall all your packages.

@webflo
Copy link
Member Author

webflo commented Sep 6, 2016

composer exec works good too.

g3r4 pushed a commit to Bixal/drupal-project that referenced this pull request May 6, 2019
Feature/WIOA-386 nested Approved-by: Gerardo Maldonado <gerardo.maldonado@bixal.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants