Skip to content
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

Parse version numbers for alpha, beta, rc releases #5

Merged
merged 3 commits into from Jun 20, 2019

Conversation

mhanberg
Copy link
Contributor

@mhanberg mhanberg commented Jun 13, 2019

The list-all command should print out the correct names of each version, even if that version is an alpha, beta, or rc release.

Current Behavior

$ asdf list-all io
2008.03.30
2010.06.06
2011.09.03
2011.09.05
2011.09.06
2011.09.12
2013.12.04
2015.11.11
2017.09.06
2019.05.22

Expected Behavior

$ bin/list-all
2008.03.30
2010.06.06
2011.09.03
2011.09.05
2011.09.06
2011.09.12
2013.12.04
2015.11.11
2017.09.06
2019.05.22-alpha

bin/list-all Outdated Show resolved Hide resolved
bin/list-all Outdated
}

function extract_versions_numbers() {
grep -o "name\": \"[0-9]\+.[0-9]\+.[0-9]\+" | sed 's/name": "//'
grep -o "name\": \".*" | sed 's/name": "\(.*\)\",/\1/'
Copy link
Owner

@mracos mracos Jun 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now with this regex we are grepping everything, which could return false positives

Screenshot 2019-06-18 20 03 41

WDYT about just modifying the regex to additionally match the release name if there is any?
I think something like grep -o "name\": \"[0-9]\+.[0-9]\+.[0-9]\+-\?\w\+" would work

Screenshot 2019-06-18 20 01 39

Copy link
Contributor Author

@mhanberg mhanberg Jun 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters too much, but I think it's a matter of what what tradeoff's you want to take.

I'll make the change.

@mracos
Copy link
Owner

@mracos mracos commented Jun 18, 2019

Thanks for your contribution @mhanberg 💙
Just some comments then we can merge it 😄

@mracos mracos merged commit 65d2e99 into mracos:master Jun 20, 2019
1 check failed
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.

None yet

2 participants