diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-07-24 22:36:03 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-08-05 10:45:21 +0200 |
commit | f08f13d1037a8ea17e63b79e2980b348154861b1 (patch) | |
tree | 67259e4dfe938b40186ad111503fc6fef1900d98 | |
parent | 5f2930b701c13e1ba0ad864e7c424c5dfed78dda (diff) |
Extend app resource file existence checks
-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. |