Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Set preferred-install for specific packages from command line #6301
It doesn't seem possible to set a global config preferred-install for specific packages from the command line.
I'm trying to setup containers for contributing to Drupal, using a third-party composer.json from drupal-composer/drupal-project. I'd like all drupal packages to be downloaded prefer-source, but all upstream dependencies to be prefer-dist.
However, from the cli this sort of thing does not seem possible:
From what I can tell by just quickly looking at the source code, it only accepts values on a global level, not on a vendor/package level: https://github.com/composer/composer/blob/master/src/Composer/Command/ConfigCommand.php#L300-L307
Pull requests are welcome.
It is worth noting that in the meantime, this can be accomplished via config as an alternative option that might be acceptable in some use cases:
That support was added by #3790 should anyone want to see related work for implementing this for cli.
It seems a cli option will involve the nuances of how explicit cli options may interact with config-based options that are inherited.
@smoqadam it depends on your familiarity with php I suppose.
Basically, the config command can be used to modify the config section of the
This is the command in question: ConfigCommand
If you read through the
Perhaps it would suffice to simply treat it as a multi-value setting, similar to these:
However, none of these currently support the
Maybe you can approach it like repositories:
Hi @Seldaek thank you for your response so fast! I used snapshot and got this working,