From 3fb4a7c540da227382ea0831c0c6424765900123 Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Tue, 17 Jun 2014 10:49:03 +0200 Subject: Fix OS X resource fork handling (Reported-by: Richard O'Keefe) If you happen to fetch a zip archive of the git repo and try to build from that, you may, for example, ask erlc to build src/._rebar.erl. ._* are OS X resource forks and not real .erl files. This may also happen with network filesystems on OS X. To fix that, limit the files compiled by rebar to include only those which start with a letter or a digit. --- src/rebar_core.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/rebar_core.erl') diff --git a/src/rebar_core.erl b/src/rebar_core.erl index 212365b..4557bb8 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -593,8 +593,7 @@ load_plugin_modules(Config, PredirsAssoc, Modules) -> ?DEBUG("Plugin dirs for ~s:~n~p~n", [Cwd, PluginDirs]), %% Find relevant sources in base_dir and plugin_dir - Erls = string:join([atom_to_list(M)++"\\.erl" || M <- Modules], "|"), - RE = "^" ++ Erls ++ "\$", + RE = string:join([atom_to_list(M)++"\\.erl" || M <- Modules], "|"), %% If a plugin is found both in base_dir and plugin_dir, the clash %% will provoke an error and we'll abort. Sources = [rebar_utils:find_files(PD, RE, false) || PD <- PluginDirs], -- cgit v1.2.1