composer
composer copied to clipboard
composer config --unset "repositories.1.exclude" does not work
{
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
},
{
"type": "composer",
"url": "https://packages.drupal.org/8",
"exclude": [
"drupal/amp"
]
},
composer config --unset "repositories.1" nukes the entire section but composer config --unset "repositories.1.exclude does not remove exclude alone.
Yeah we don't support very deep editing like this.. especially for repos. Might be doable so I'll leave this open if I (or someone else 👀) ever get to it.. but I wouldn't hold my breath, just open the file in an editor for complex operations.
So I am guessing Config::removeProperty is the method to look into. As far as I can tell the code is quite universal but if (strpos($key, 'extra.') === 0 || strpos($key, 'scripts.') === 0) { restricts it to extra and scripts. I am not familiar enough with composer to know why this restriction is there and what would break if were to simply remove it.
Yeah we could perhaps do it for repos, I am not sure if it will work or not.. You can try, but the regex json modifications need to be heavily covered by tests as it's an art more than a science..