-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Description
composer --version used to say "Composer version x.y…", but now no longer contains the "version " part for stable releases (but it's still there for dev snapshots):
% composer --version
Composer version 2.2.7 2022-02-25 11:12:27
% composer selfupdate --stable
Upgrading to version 2.3.2 (stable channel).
…
% composer --version
Composer 2.3.2 2022-03-30 20:45:25
% composer selfupdate --snapshot
Upgrading to version 29513c15da7115874ea247fe281ccd48c768b2f5 (snapshot channel).
…
% composer --version
Composer version 2.3-dev (2.3-dev+29513c15da7115874ea247fe281ccd48c768b2f5) 2022-03-31 15:26:35The coloring is also different:
- when "
version" is there, "Composer" is printed green and the version number (with dev suffix) is printed yellow; - when "
version" is missing, only the version number is printed green
This may (well... for me, it did) break code that greps out the version number.
The cause lies in
composer/src/Composer/Console/Application.php
Lines 558 to 571 in 29513c1
| public function getLongVersion(): string | |
| { | |
| if (Composer::BRANCH_ALIAS_VERSION && Composer::BRANCH_ALIAS_VERSION !== '@package_branch_alias_version'.'@') { | |
| return sprintf( | |
| '<info>%s</info> version <comment>%s (%s)</comment> %s', | |
| $this->getName(), | |
| Composer::BRANCH_ALIAS_VERSION, | |
| $this->getVersion(), | |
| Composer::RELEASE_DATE | |
| ); | |
| } | |
| return parent::getLongVersion() . ' ' . Composer::RELEASE_DATE; | |
| } |
parent::getLongVersion() in Symfony 5.4 (or earlier) now doesn't contain "version" anymore:
Reactions are currently unavailable