Explorar el Código

Merge pull request #1575 from gleber/bare-paths-separator

Bare compiler: support multiple paths wildcards.
pull/1580/head
Fred Hebert hace 8 años
cometido por GitHub
padre
commit
83b41523fa
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. +5
    -3
      src/rebar_prv_bare_compile.erl

+ 5
- 3
src/rebar_prv_bare_compile.erl Ver fichero

@ -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()),

Cargando…
Cancelar
Guardar