소스 검색

Merge pull request #825 from fauxsoup/git-versioning-2

Git versioning 2
pull/834/head
Tristan Sloughter 9 년 전
부모
커밋
86478aa2e6
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. +8
    -2
      src/rebar_git_resource.erl

+ 8
- 2
src/rebar_git_resource.erl 파일 보기

@ -194,10 +194,16 @@ parse_tags(Dir) ->
{error, _} ->
{undefined, "0.0.0"};
{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]} ->
{Tag, Vsn};
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.

불러오는 중...
취소
저장