소스 검색

Make sure to pass dir of app when invoking git; enhance shell logging output

pull/3/head
Dave Smith 14 년 전
부모
커밋
4be3631687
2개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. +4
    -3
      src/rebar_app_utils.erl
  2. +1
    -1
      src/rebar_utils.erl

+ 4
- 3
src/rebar_app_utils.erl 파일 보기

@ -89,7 +89,8 @@ app_applications(AppFile) ->
app_vsn(AppFile) ->
case load_app_file(AppFile) of
{ok, _, AppInfo} ->
vcs_vsn(get_value(vsn, AppInfo, AppFile));
AppDir = filename:dirname(filename:dirname(AppFile)),
vcs_vsn(get_value(vsn, AppInfo, AppFile), AppDir);
{error, Reason} ->
?ABORT("Failed to extract vsn from ~s: ~p\n",
[AppFile, Reason])
@ -125,12 +126,12 @@ get_value(Key, AppInfo, AppFile) ->
Value
end.
vcs_vsn(Vcs) ->
vcs_vsn(Vcs, Dir) ->
case vcs_vsn_cmd(Vcs) of
{unknown, VsnString} ->
VsnString;
Cmd ->
{ok, VsnString} = rebar_utils:sh(Cmd, [{use_stdout, false}]),
{ok, VsnString} = rebar_utils:sh(Cmd, [{cd, Dir}, {use_stdout, false}]),
string:strip(VsnString, right, $\n)
end.

+ 1
- 1
src/rebar_utils.erl 파일 보기

@ -75,7 +75,7 @@ get_arch() ->
%% Val = string() | false
%%
sh(Command0, Options0) ->
?INFO("sh: ~s\n~p\n", [Command0, Options0]),
?INFO("sh info:\n\tcwd: ~pspan>\n\tn>cmd: ~s\n\topts: ~p\n", [get_cwd(), Command0, Options0]),
DefaultOptions = [use_stdout, abort_on_error],
Options = [expand_sh_flag(V)

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