You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp package update reports a wrong count when the same package is named more than once #267
Later, $num_packages = count( $packages_to_update ) is 2. array_intersect( $packages_to_update, $updated_packages ) also keeps the duplicates, so $num_updated is 2. The two counts match and the plural message is printed.
Steps to reproduce
Run wp package install wp-cli-test/updateable-package:v3.0.0.
Change the constraint in the packages composer.json from v3.0.0 to >=3.0.0.
Run wp package update wp-cli-test/updateable-package wp-cli-test/updateable-package.
Expected
Success: Package updated successfully.
Actual
Success: All 2 packages updated successfully.
If the package has no update, the output is Packages already at latest versions. (plural) instead of Package already at latest version.
Suggested fix
Remove duplicate names after the validation loop, for example with array_unique().
I would like to work on this. Please assign it to me.
Activity