From 59d1d0c34d771e8050fe2358a675139f517187b5 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Fri, 23 Jan 2015 10:55:38 +0100 Subject: [PATCH] Fix incorrect "not an app dir" warning --- src/rebar_deps.erl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 952276c..24a20c1 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -457,8 +457,19 @@ is_app_available(Config, App, VsnRegex, Path, _IsRaw = false) -> {AppFile, {expected, App}, {has, OtherApp}}}}} end; false -> - ?WARN("Expected ~s to be an app dir (containing ebin/*.app), " - "but no .app found.\n", [Path]), + case filelib:is_dir(Path) of + true -> + %% Path is a directory, but it's not an app dir. + ?WARN("Directory expected to be an app dir, but no " + "app file found ~n" + "in ebin/ or src/:~n~s~n", + [Path]); + false -> + %% Path is not a directory, so it cannot be an app dir. + %% TODO: maybe we can avoid checking non-existing dirs + ?DEBUG("Directory expected to be an app dir, " + "but it doesn't exist (yet?):~n~s~n", [Path]) + end, {Config, {false, {missing_app_file, Path}}} end; is_app_available(Config, App, _VsnRegex, Path, _IsRaw = true) ->