|
@ -194,10 +194,16 @@ parse_tags(Dir) -> |
|
|
{error, _} -> |
|
|
{error, _} -> |
|
|
{undefined, "0.0.0"}; |
|
|
{undefined, "0.0.0"}; |
|
|
{ok, Line} -> |
|
|
{ok, Line} -> |
|
|
case re:run(Line, "(\\(|\\s)tag:\\s(v?([^,\\)]+))", [{capture, [2, 3], list}]) of |
|
|
|
|
|
|
|
|
case re:run(Line, "(\\(|\\s)(HEAD,\\s)tag:\\s(v?([^,\\)]+))", [{capture, [3, 4], list}]) of |
|
|
{match,[Tag, Vsn]} -> |
|
|
{match,[Tag, Vsn]} -> |
|
|
{Tag, Vsn}; |
|
|
{Tag, Vsn}; |
|
|
nomatch -> |
|
|
nomatch -> |
|
|
{undefined, "0.0.0"} |
|
|
|
|
|
|
|
|
case rebar_utils:sh("git describe --tags --abbrev=0", |
|
|
|
|
|
[{use_stdout, false}, return_on_error, {cd, Dir}]) of |
|
|
|
|
|
{error, _} -> |
|
|
|
|
|
{undefined, "0.0.0"}; |
|
|
|
|
|
{ok, LatestVsn} -> |
|
|
|
|
|
{undefined, string:strip(LatestVsn, both, $\n)} |
|
|
|
|
|
end |
|
|
end |
|
|
end |
|
|
end. |
|
|
end. |