mirror of
https://github.com/correl/rebar.git
synced 2024-12-24 03:00:16 +00:00
Enable target_dir to be passed as command-line parameter
This commit is contained in:
parent
127483f32b
commit
c32d26f509
1 changed files with 15 additions and 10 deletions
|
@ -100,17 +100,22 @@ sys_tuple(ReltoolConfig) ->
|
|||
%% found, use the name of the release as the default target directory.
|
||||
%%
|
||||
target_dir(ReltoolConfig) ->
|
||||
case lists:keysearch(target_dir, 1, ReltoolConfig) of
|
||||
{value, {target_dir, TargetDir}} ->
|
||||
filename:absname(TargetDir);
|
||||
false ->
|
||||
{sys, SysInfo} = sys_tuple(ReltoolConfig),
|
||||
case lists:keysearch(rel, 1, SysInfo) of
|
||||
{value, {rel, Name, _Vsn, _Apps}} ->
|
||||
filename:absname(Name);
|
||||
case rebar_config:get_global(target_dir, undefined) of
|
||||
undefined ->
|
||||
case lists:keysearch(target_dir, 1, ReltoolConfig) of
|
||||
{value, {target_dir, TargetDir}} ->
|
||||
filename:absname(TargetDir);
|
||||
false ->
|
||||
filename:absname("target")
|
||||
end
|
||||
{sys, SysInfo} = sys_tuple(ReltoolConfig),
|
||||
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.
|
||||
|
||||
%%
|
||||
|
|
Loading…
Reference in a new issue