From f08f13d1037a8ea17e63b79e2980b348154861b1 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Sun, 24 Jul 2011 22:36:03 +0200 Subject: [PATCH] Extend app resource file existence checks --- src/rebar_app_utils.erl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl index b47520a..285bb5e 100644 --- a/src/rebar_app_utils.erl +++ b/src/rebar_app_utils.erl @@ -45,18 +45,26 @@ is_app_dir() -> is_app_dir(rebar_utils:get_cwd()). is_app_dir(Dir) -> - AppSrc = filename:join([Dir, "src", "*.app.src"]), + SrcDir = filename:join([Dir, "src"]), + AppSrc = filename:join([SrcDir, "*.app.src"]), case filelib:wildcard(AppSrc) of [AppSrcFile] -> {true, AppSrcFile}; - _ -> - App = filename:join([Dir, "ebin", "*.app"]), + [] -> + EbinDir = filename:join([Dir, "ebin"]), + App = filename:join([EbinDir, "*.app"]), case filelib:wildcard(App) of [AppFile] -> {true, AppFile}; + [] -> + false; _ -> + ?ERROR("More than one .app file in ~s~n", [EbinDir]), false - end + end; + _ -> + ?ERROR("More than one .app.src file in ~s~n", [SrcDir]), + false end.