diff --git a/src/rebar_app_discover.erl b/src/rebar_app_discover.erl index ca837c54..0a5bede5 100644 --- a/src/rebar_app_discover.erl +++ b/src/rebar_app_discover.erl @@ -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 diff --git a/test/rebar_test_utils.erl b/test/rebar_test_utils.erl index b93403ab..99547d66 100644 --- a/test/rebar_test_utils.erl +++ b/test/rebar_test_utils.erl @@ -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", "*"])),