composer-bin-plugin
composer-bin-plugin copied to clipboard
Can outdated command be forwarded as well?
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! 🙂
That's a good idea. PRs are welcomed! I don't think it requires much more than updating https://github.com/bamarni/composer-bin-plugin/blob/0f2f6f5b69c51333bd8e07d6260d5d975bcab2ae/src/BamarniBinPlugin.php#L36
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!
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.
I think we could adapt this condition: https://github.com/bamarni/composer-bin-plugin/blob/0f2f6f5b69c51333bd8e07d6260d5d975bcab2ae/src/BamarniBinPlugin.php#L134
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
And I can see that
composer bin all outdatedalso does not work.
Yep, for me it checks the first package only :(