Currently I am developing a repository X
that is available on my private Packagist, which is the production version. However, for reasons of development speed, I am using a local repository from same project using symlink/junction.
Something like that:
"repositories": [
{
"type": "path",
"url": "../plataform"
}
],
"require": {
"project/x": "dev-master"
},
But I when I commit a change ocurred on this composer.json
I need always modify it to correct repository (removing repositories
key and modifying dev-master
to current version);
My doubt is: is possible create somekind of local override for that? I mean, a method to include an optional file that exists locally, but not remotely (production server) that will do this job without I need edit it before commit all the time.
Pseudo-example:
On official commit I should have something like:
"require": {
"project/x": "~1.0"
},
"overrider": "composer.local.json"
And then if the overrider
file is present, then it will be merged by the own composer
.
composer.local.json
file should be like:
{
"repositories": [
{
"type": "path",
"url": "../plataform"
}
],
"require": {
"project/x": "dev-master"
}
}
I found this plugin wikimedia/composer-merge-plugin that solves my problem totally. Tested and approved.
I just needed of "replace": true
feature and include my local-only composer.local.json
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With