summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-06-20 19:35:47 -0400
committerGitHub <noreply@github.com>2017-06-20 19:35:47 -0400
commit83b41523fa010283dae86680ac2f884fed47a34d (patch)
tree2cad32116702ca94c2704dfe4e446b336fa321b4 /src
parent983290c695c64352eee1b6e685587b58e0d54fa5 (diff)
parentc94d3d2a16ccfdb05f81ad235da4910f78c8d573 (diff)
Merge pull request #1575 from gleber/bare-paths-separator
Bare compiler: support multiple paths wildcards.
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_bare_compile.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/rebar_prv_bare_compile.erl b/src/rebar_prv_bare_compile.erl
index 201620a..6f1ac16 100644
--- a/src/rebar_prv_bare_compile.erl
+++ b/src/rebar_prv_bare_compile.erl
@@ -29,7 +29,8 @@ init(State) ->
{example, ""},
{short_desc, ""},
{desc, ""},
- {opts, [{paths, $p, "paths", string, "Wildcard path of ebin directories to add to code path"}]}])),
+ {opts, [{paths, $p, "paths", string, "Wildcard paths of ebin directories to add to code path, separated by a colon"},
+ {separator, $s, "separator", string, "In case of multiple return paths, the separator character to use to join them."}]}])),
{ok, State1}.
-spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
@@ -39,8 +40,9 @@ do(State) ->
%% Add code paths from --paths to the beginning of the code path
{RawOpts, _} = rebar_state:command_parsed_args(State),
Paths = proplists:get_value(paths, RawOpts),
- CodePaths = filelib:wildcard(Paths),
- code:add_pathsa(CodePaths),
+ Sep = proplists:get_value(separator, RawOpts, " "),
+ [ code:add_pathsa(filelib:wildcard(PathWildcard))
+ || PathWildcard <- string:tokens(Paths, Sep) ],
[AppInfo] = rebar_state:project_apps(State),
AppInfo1 = rebar_app_info:out_dir(AppInfo, rebar_dir:get_cwd()),