Explorar el Código

filter out non-directories from app discover search

pull/2239/head
Tristan Sloughter hace 5 años
padre
commit
b3fad9ac0c
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: AAB97DDECCEB8150
Se han modificado 2 ficheros con 9 adiciones y 3 borrados
  1. +7
    -2
      src/rebar_app_discover.erl
  2. +2
    -1
      test/rebar_test_utils.erl

+ 7
- 2
src/rebar_app_discover.erl Ver fichero

@ -216,8 +216,13 @@ reset_hooks(Opts, CurrentProfiles) ->
-spec all_app_dirs([file:name()]) -> [{file:name(), [file:name()]}].
all_app_dirs(LibDirs) ->
lists:flatmap(fun(LibDir) ->
{_, SrcDirs} = find_config_src(LibDir, ["src"]),
app_dirs(LibDir, SrcDirs)
case filelib:is_dir(LibDir) of
true ->
{_, SrcDirs} = find_config_src(LibDir, ["src"]),
app_dirs(LibDir, SrcDirs);
false ->
[]
end
end, LibDirs).
%% @private find the directories for all apps based on their source dirs

+ 2
- 1
test/rebar_test_utils.erl Ver fichero

@ -260,7 +260,8 @@ top_level_deps([{{Name, Vsn, Ref}, _} | Deps]) ->
%%%%%%%%%%%%%%%
check_results(AppDir, Expected, ProfileRun) ->
BuildDirs = filelib:wildcard(filename:join([AppDir, "_build", ProfileRun, "lib", "*"])),
BuildSubDirs = filelib:wildcard(filename:join([AppDir, "_build", ProfileRun, "lib", "*", "*"])),
BuildSubDirs = [D || D <- filelib:wildcard(filename:join([AppDir, "_build", ProfileRun, "lib", "*", "*"])),
filelib:is_dir(D)],
PluginDirs = filelib:wildcard(filename:join([AppDir, "_build", ProfileRun, "plugins", "*"])),
GlobalPluginDirs = filelib:wildcard(filename:join([AppDir, "global", "plugins", "*"])),
CheckoutsDirs = filelib:wildcard(filename:join([AppDir, "_checkouts", "*"])),

Cargando…
Cancelar
Guardar