10000 parse github version numbers for comparison by dominicletz · Pull Request #16 · tj/go-update · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

parse github version numbers for comparison #16

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dominicletz
Copy link
Contributor

This piece does parse the version numbers ignoring any initial 'v' and splitting numbers at each "." or "-"

The comparison works for semantic versioning as well as using git describe output. Some comparison examples:

'v1.2.3-22' > 'v1.2.3'
'v1.2.4' > 'v1.2.3'
'v2' > 'v1.2.3'
'v2' == '2'
'v2.0' == 'v2'
'v2.0.0.0.0' == 'v2'

@tj
Copy link
Owner
tj commented May 6, 2020

Sweet! I just moved out this semver stuff from another project, maybe we could use that? I don't have support for -alpha etc at the moment though

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

Successfully merging this pull request may close these issues.

2 participants
0