Skip to content

Conversation

@WarningImHack3r
Copy link
Contributor

@WarningImHack3r WarningImHack3r commented Dec 29, 2025

I met the following case:
scenario

This PR fixes this by omitting the trailing zeros during version comparison if all the other digits are equal.

Resolve #1176

Note

The dropLast implementation comes from here: https://stackoverflow.com/a/62306093/12070367

Reformat code.

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
@rgoldberg rgoldberg added this to the 5.0.2 milestone Dec 29, 2025
@sonarqubecloud
Copy link

@rgoldberg rgoldberg merged commit 9ba2cf5 into mas-cli:main Dec 29, 2025
8 checks passed
@rgoldberg
Copy link
Member

@WarningImHack3r Thanks. I updated your code, then merged it. Will release 5.0.2.

@WarningImHack3r WarningImHack3r deleted the trailing-zeros branch December 29, 2025 09:06
@jabenninghoff
Copy link

Thanks @WarningImHack3r @rgoldberg, this fixed a very similar issue for me! App Store reported version 1.3.2. (with a trailing dot) and downloaded version was 1.3.2 (no dot)

@rgoldberg
Copy link
Member

@jabenninghoff Ignoring an empty element should actually be from #1155 from mas 4.1.2. but this PR is obviously useful for trailing zero elements.

@jabenninghoff
Copy link

Ah, I hadn't checked in a while, thanks just the same!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore trailing zero components in inaccurate outdated version comparison

3 participants