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_rel_discovery.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/rcl_rel_discovery.erl') diff --git a/src/rcl_rel_discovery.erl b/src/rcl_rel_discovery.erl index 38d7913..d9012ea 100644 --- a/src/rcl_rel_discovery.erl +++ b/src/rcl_rel_discovery.erl @@ -74,12 +74,13 @@ resolve_rel_metadata(State, LibDirs, AppMeta) -> case Errors of [] -> + ReleaseMeta1 = [RelMeta || {ok, RelMeta} <- ReleaseMeta0], rcl_log:debug(rcl_state:log(State), fun() -> ["Resolved the following OTP Releases from the system: \n", - [[rcl_release:format(1, Rel), "\n"] || Rel <- ReleaseMeta0]] + [[rcl_release:format(1, Rel), "\n"] || Rel <- ReleaseMeta1]] end), - {ok, ReleaseMeta0}; + {ok, ReleaseMeta1}; _ -> ?RCL_ERROR(Errors) end. @@ -105,10 +106,10 @@ discover_dir(File, AppMeta, file) -> | {error, Reason::term()} | {noresult, false}. is_valid_release(File, AppMeta) -> - case lists:suffix(".rel", File) of - true -> + case filename:extension(File) of + <<".rel">>-> resolve_release(File, AppMeta); - false -> + _ -> {noresult, false} end. -- cgit v1.2.3