mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Extend app resource file existence checks
This commit is contained in:
parent
5f2930b701
commit
f08f13d103
1 changed files with 12 additions and 4 deletions
|
@ -45,18 +45,26 @@ is_app_dir() ->
|
||||||
is_app_dir(rebar_utils:get_cwd()).
|
is_app_dir(rebar_utils:get_cwd()).
|
||||||
|
|
||||||
is_app_dir(Dir) ->
|
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
|
case filelib:wildcard(AppSrc) of
|
||||||
[AppSrcFile] ->
|
[AppSrcFile] ->
|
||||||
{true, AppSrcFile};
|
{true, AppSrcFile};
|
||||||
_ ->
|
[] ->
|
||||||
App = filename:join([Dir, "ebin", "*.app"]),
|
EbinDir = filename:join([Dir, "ebin"]),
|
||||||
|
App = filename:join([EbinDir, "*.app"]),
|
||||||
case filelib:wildcard(App) of
|
case filelib:wildcard(App) of
|
||||||
[AppFile] ->
|
[AppFile] ->
|
||||||
{true, AppFile};
|
{true, AppFile};
|
||||||
|
[] ->
|
||||||
|
false;
|
||||||
_ ->
|
_ ->
|
||||||
|
?ERROR("More than one .app file in ~s~n", [EbinDir]),
|
||||||
|
false
|
||||||
|
end;
|
||||||
|
_ ->
|
||||||
|
?ERROR("More than one .app.src file in ~s~n", [SrcDir]),
|
||||||
false
|
false
|
||||||
end
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue