From 86e4c5d5ef39ce9c1ff2c7f9f30e5ab036108f11 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Sat, 22 Aug 2015 09:18:47 -0500 Subject: do not override user cli supplied outputdir for relx --- src/rebar_relx.erl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') 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))]. -- cgit v1.1