summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-08-23 05:48:52 +1200
committerFred Hebert <mononcqc@ferd.ca>2015-08-23 05:48:52 +1200
commit8c826fa92ac2f6f5ebeae92294c367ddc74650d9 (patch)
tree1d5ac02822ea64c5de1c5457e4834aeb85067fc7 /src
parent1f6516b231260a1b2e48f9b86e37a5d317d4983c (diff)
parent86e4c5d5ef39ce9c1ff2c7f9f30e5ab036108f11 (diff)
Merge pull request #735 from tsloughter/relx_output_dir
do not override user cli supplied outputdir for relx
Diffstat (limited to 'src')
-rw-r--r--src/rebar_relx.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rebar_relx.erl b/src/rebar_relx.erl
index a3adedd..699c780 100644
--- a/src/rebar_relx.erl
+++ b/src/rebar_relx.erl
@@ -28,14 +28,12 @@ do(Module, Command, Provider, State) ->
case rebar_state:get(State, relx, []) of
[] ->
relx:main([{lib_dirs, LibDirs}
- ,{output_dir, OutputDir}
- ,{caller, api}], AllOptions);
+ ,{caller, api} | output_dir(OutputDir, Options)], AllOptions);
Config ->
Config1 = update_config(Config),
relx:main([{lib_dirs, LibDirs}
,{config, Config1}
- ,{output_dir, OutputDir}
- ,{caller, api}], AllOptions)
+ ,{caller, api} | output_dir(OutputDir, Options)], AllOptions)
end,
rebar_hooks:run_all_hooks(Cwd, post, Provider, Providers, State),
{ok, State}
@@ -67,3 +65,8 @@ update_config(Config) ->
end
end, {[], []}, Config),
lists:reverse(Special) ++ Other.
+
+%% Don't override output_dir if the user passed one on the command line
+output_dir(OutputDir, Options) ->
+ [{output_dir, OutputDir} || not(lists:member("-o", Options))
+ andalso not(lists:member("--output-dir", Options))].