From 4e863bd88520be1a786026eeb861cb70d00e7b01 Mon Sep 17 00:00:00 2001 From: Eric B Merritt Date: Tue, 9 Apr 2013 16:40:29 -0700 Subject: fixes #29 - look for common sub dirs for discovery With this change relcool looks for the common sub directories to add to the search. Those directories are now, relative to the project dir, `apps`, `lib`, `ebin`, and the release output dir. These automatic subdirs can be disabled by setting `disable_project_subdirs` to `true` in the config. The release output dir is also added to the discovery process. This can be disabled by setting `disable_discover_release_output` to true. --- src/rcl_app_discovery.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rcl_app_discovery.erl') diff --git a/src/rcl_app_discovery.erl b/src/rcl_app_discovery.erl index 43557c4..1f1ecc8 100644 --- a/src/rcl_app_discovery.erl +++ b/src/rcl_app_discovery.erl @@ -86,7 +86,7 @@ setup_overrides(State, AppMetas0) -> Overrides = rcl_state:overrides(State), AppMetas1 = [AppMeta || AppMeta <- AppMetas0, not lists:keymember(app_name(AppMeta), 1, Overrides)], - [case is_valid_otp_app(filename:join([FileName, "ebin", + [case is_valid_otp_app(filename:join([FileName, <<"ebin">>, erlang:atom_to_list(AppName) ++ ".app"])) of {noresult, false} -> {error, {invalid_override, AppName, FileName}}; @@ -134,11 +134,11 @@ is_valid_otp_app(File) -> %% Is this an ebin dir? EbinDir = filename:dirname(File), case filename:basename(EbinDir) of - "ebin" -> - case lists:suffix(".app", File) of - true -> + <<"ebin">> -> + case filename:extension(File) of + <<".app">> -> has_at_least_one_beam(EbinDir, File); - false -> + _ -> {noresult, false} end; _ -> -- cgit v1.2.3