Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.54k stars 848 forks source link

Consider adding composer global bin dir to path #2588

Closed ssnepenthe closed 1 year ago

ssnepenthe commented 2 years ago

Any objections to adding composer global bin dir to path by default?

Same as for ruby gems here: https://github.com/Varying-Vagrant-Vagrants/VVV/blob/5742364765c4adaf5be62aa129c0d93581fb0560/provision/core/env/homedir/.bash_aliases#L35-L40

After a quick skim over the composer installer, it looks like the composer home dir should be ~/.config/composer for a freshly provisioned machine, although it can be overridden.

The global bin dir would then be at ~/.config/composer/vendor/bin.

Alternatively it looks like we should be able to ask composer by running composer global config bin-dir --absolute (https://getcomposer.org/doc/03-cli.md#global)

tomjn commented 2 years ago

sure, note that this looks to be user specific, so anything installed globally via composer in a provisioner will need noroot before it, and it'll need doing for both the vagrant and the root user