Enable target_dir to be passed as command-line parameter

This commit is contained in:
Dave Smith 2010-06-22 10:25:42 -06:00
parent 127483f32b
commit c32d26f509

View file

@ -100,17 +100,22 @@ sys_tuple(ReltoolConfig) ->
%% found, use the name of the release as the default target directory. %% found, use the name of the release as the default target directory.
%% %%
target_dir(ReltoolConfig) -> target_dir(ReltoolConfig) ->
case lists:keysearch(target_dir, 1, ReltoolConfig) of case rebar_config:get_global(target_dir, undefined) of
{value, {target_dir, TargetDir}} -> undefined ->
filename:absname(TargetDir); case lists:keysearch(target_dir, 1, ReltoolConfig) of
false -> {value, {target_dir, TargetDir}} ->
{sys, SysInfo} = sys_tuple(ReltoolConfig), filename:absname(TargetDir);
case lists:keysearch(rel, 1, SysInfo) of
{value, {rel, Name, _Vsn, _Apps}} ->
filename:absname(Name);
false -> false ->
filename:absname("target") {sys, SysInfo} = sys_tuple(ReltoolConfig),
end case lists:keysearch(rel, 1, SysInfo) of
{value, {rel, Name, _Vsn, _Apps}} ->
filename:absname(Name);
false ->
filename:absname("target")
end
end;
TargetDir ->
filename:absname(TargetDir)
end. end.
%% %%