mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Make sure to pass dir of app when invoking git; enhance shell logging output
This commit is contained in:
parent
27de53125e
commit
4be3631687
2 changed files with 5 additions and 4 deletions
|
@ -89,7 +89,8 @@ app_applications(AppFile) ->
|
||||||
app_vsn(AppFile) ->
|
app_vsn(AppFile) ->
|
||||||
case load_app_file(AppFile) of
|
case load_app_file(AppFile) of
|
||||||
{ok, _, AppInfo} ->
|
{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} ->
|
{error, Reason} ->
|
||||||
?ABORT("Failed to extract vsn from ~s: ~p\n",
|
?ABORT("Failed to extract vsn from ~s: ~p\n",
|
||||||
[AppFile, Reason])
|
[AppFile, Reason])
|
||||||
|
@ -125,12 +126,12 @@ get_value(Key, AppInfo, AppFile) ->
|
||||||
Value
|
Value
|
||||||
end.
|
end.
|
||||||
|
|
||||||
vcs_vsn(Vcs) ->
|
vcs_vsn(Vcs, Dir) ->
|
||||||
case vcs_vsn_cmd(Vcs) of
|
case vcs_vsn_cmd(Vcs) of
|
||||||
{unknown, VsnString} ->
|
{unknown, VsnString} ->
|
||||||
VsnString;
|
VsnString;
|
||||||
Cmd ->
|
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)
|
string:strip(VsnString, right, $\n)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ get_arch() ->
|
||||||
%% Val = string() | false
|
%% Val = string() | false
|
||||||
%%
|
%%
|
||||||
sh(Command0, Options0) ->
|
sh(Command0, Options0) ->
|
||||||
?INFO("sh: ~s\n~p\n", [Command0, Options0]),
|
?INFO("sh info:\n\tcwd: ~p\n\tcmd: ~s\n\topts: ~p\n", [get_cwd(), Command0, Options0]),
|
||||||
|
|
||||||
DefaultOptions = [use_stdout, abort_on_error],
|
DefaultOptions = [use_stdout, abort_on_error],
|
||||||
Options = [expand_sh_flag(V)
|
Options = [expand_sh_flag(V)
|
||||||
|
|
Loading…
Reference in a new issue