Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composer config --unset "repositories.1.exclude" does not work #11696

Closed
chx opened this issue Oct 25, 2023 · 4 comments
Closed

composer config --unset "repositories.1.exclude" does not work #11696

chx opened this issue Oct 25, 2023 · 4 comments
Labels
Milestone

Comments

@chx
Copy link
Contributor

chx commented Oct 25, 2023

{
    "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.

@Seldaek
Copy link
Member

Seldaek commented Oct 25, 2023

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.

@Seldaek Seldaek added this to the Nice To Have milestone Oct 25, 2023
@chx
Copy link
Contributor Author

chx commented Oct 28, 2023

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.

@Seldaek
Copy link
Member

Seldaek commented Oct 31, 2023

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..

@Seldaek
Copy link
Member

Seldaek commented Sep 18, 2024

Closing here as I don't think anyone will ever look into this. It's just too fringe.

@Seldaek Seldaek closed this as completed Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants