composer-patches
composer-patches copied to clipboard
Possibilities to give the command "patches-repatch" options for the composer install
Verification
- [X] I have updated Composer to the most recent stable release (
composer self-update) - [X] I have updated Composer Patches to the most recent stable release (
composer update cweagans/composer-patches) - [X] I am using one of the supported PHP versions (8.0+)
- [X] I have searched existing issues and discussions for my idea.
Is your feature request related to a problem?
Currently you have to use the command patches-repatch to execute the patches, which then executes the normal Composer install routine.
But now you have the problem that you can not use options like --no-dev.
Describe your proposed solution(s)
The possibility to pass the command patches-repatch a new parameter "install-options" with a string in the following format: "--no-dev --no-interactions"
From this you can then store the options in the ArrayInput with the value true with an explode to " ".
Describe alternatives
No response
Additional context
No response
👋 Thanks for the idea! Please remember that this is an open source project - feature requests may or may not be implemented, and if they are, the timeline is unknown. If you need a guaranteed implementation or timeline, sponsorships are welcome!
Seems reasonable! It'll be a bit until I can work on this, but if you open a PR in the mean time, I'd be glad to review!
Hi @cweagans, with pleasure! PR is created.
I was looking if an issue for this problem already exists or not and am lucky to see a PR already. I hope this gets released soon.
Another way to think about this would be a --pre-install option. In my projects I usually use two custom composer scripts which look like this:
"scripts": {
"deploy-staging": [
"git pull -p",
"@composer validate",
"@composer install --optimize-autoloader"
],
"deploy": [
"git pull -p",
"@composer validate",
"@composer install --no-dev --optimize-autoloader"
]
}
With the --pre-install option this would be possible:
"scripts": {
"pre-install-cmd": [
"@composer patches-repatch --pre-install"
],
"deploy-staging": [
"git pull -p",
"@composer validate",
"@composer install --optimize-autoloader"
],
"deploy": [
"git pull -p",
"@composer validate",
"@composer install --no-dev --optimize-autoloader"
]
}
This way patches-repatch would do its job as part of the composer install pre-hooks without executing the composer install by itself. Currently this is not possible because that would lead to an endless loop.
any update on this?