diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_app_utils.erl | 16 |
1 files 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. |