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

Can outdated command be forwarded as well? #149

Open
hostep opened this issue Feb 23, 2023 · 5 comments
Open

Can outdated command be forwarded as well? #149

hostep opened this issue Feb 23, 2023 · 5 comments

Comments

@hostep
Copy link

hostep commented Feb 23, 2023

Hi there

Thank you very much for this wonderful composer plugin, very happy with it so far!

I've noticed with the forward-command config, that only composer install and composer update are being forwarded to the bin directories.
But I sometimes like to run composer outdated as well against everything, and right now I need to do this one by one, which is a bit annoying.
Would be nice if this command can also be forwarded.

Thanks for considering this! 🙂

@theofidry
Copy link
Collaborator

That's a good idea. PRs are welcomed! I don't think it requires much more than updating

private const FORWARDED_COMMANDS = ['install', 'update'];

@hostep
Copy link
Author

hostep commented Feb 27, 2023

Ah cool, good to know. I'll see if I can find some time in the next few days/weeks to test this out and send a PR.
Thanks for the info!

@hostep
Copy link
Author

hostep commented Mar 6, 2023

Just gave it a little try, it's unfortunately a bit more complex. Because composer outdated is more of an alias to composer show --outdated

So adding outdated to the FORWARDED_COMMANDS const does not work. When I add show to it, it does not work with composer outdated, but does work with composer show --outdated.
And I can see that composer bin all outdated also does not work.

I haven't debugged further since I lack the time at the moment.

What do you think, should we try to make composer outdated also working somehow? It would be convenient in my opinion.

@theofidry
Copy link
Collaborator

theofidry commented Mar 11, 2023

I think we could adapt this condition:

&& in_array($commandName, self::FORWARDED_COMMANDS, true)

Instead of just checking the in_array we could check if it's the show command with the outdated flag for example. The check could also be extracted into a dedicated method to keep it understandable

@LastDragon-ru
Copy link

And I can see that composer bin all outdated also does not work.

Yep, for me it checks the first package only :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants