Skip to content

Commit

Permalink
Merge pull request #913 from essen/fix-parse-vsn
Browse files Browse the repository at this point in the history
Make rlx_util:parse_vsn parse integer versions
  • Loading branch information
ferd authored May 24, 2022
2 parents d72ee1a + 58266fc commit d57e7c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/rlx_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ parse_vsn(Vsn) ->
{match, [Major, Minor, Patch, PreRelease, Build]} ->
{{list_to_integer(Major), list_to_integer(Minor), list_to_integer(Patch)}, {PreRelease, Build}};
_ ->
0
try list_to_integer(Vsn) of
Major ->
{{Major, 0, 0}, {"", ""}}
catch _:_ ->
{{0, 0, 0}, {"", ""}}
end
end.

%% less than or equal to comparison for versions parsed with `parse_vsn'
Expand Down

0 comments on commit d57e7c0

Please sign in to comment.