summaryrefslogtreecommitdiff
path: root/src/rebar_base_compiler.erl
diff options
context:
space:
mode:
authorTuncer Ayaz <tuncer.ayaz@gmail.com>2014-06-17 10:49:03 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2014-07-25 20:52:30 +0200
commit3fb4a7c540da227382ea0831c0c6424765900123 (patch)
tree8a47941bbc34397269c9b42a84e33db6d0294476 /src/rebar_base_compiler.erl
parente8a6cfe04ab0612dcd089c7aed035520e3dd9aee (diff)
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.
Diffstat (limited to 'src/rebar_base_compiler.erl')
-rw-r--r--src/rebar_base_compiler.erl9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl
index 1957070..b400512 100644
--- a/src/rebar_base_compiler.erl
+++ b/src/rebar_base_compiler.erl
@@ -28,8 +28,11 @@
-include("rebar.hrl").
--export([run/4, run/7, run/8,
- ok_tuple/3, error_tuple/5]).
+-export([run/4,
+ run/7,
+ run/8,
+ ok_tuple/3,
+ error_tuple/5]).
%% ===================================================================
%% Public API
@@ -60,7 +63,7 @@ run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt,
run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt,
Compile3Fn, Opts) ->
%% Convert simple extension to proper regex
- SourceExtRe = ".*\\" ++ SourceExt ++ [$$],
+ SourceExtRe = "^[^._].*\\" ++ SourceExt ++ [$$],
Recursive = proplists:get_value(recursive, Opts, true),
%% Find all possible source files