summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2016-12-09 09:16:15 -0500
committerFred Hebert <mononcqc@ferd.ca>2016-12-09 09:16:15 -0500
commitfc12b06d27d0e1df4719a2e38e241f36637d369e (patch)
treed4747be0a966136b18a7a3f5593863a9d6d17061
parent9828f4464b2f89c174a8b32f61b69724b1fe77f3 (diff)
Fix regex match for ignored file
The regex mistakenly matched too many files (any character followed by an underscore) rather than only files starting in '._' This properly escapes the expressions to work in all cases.
-rw-r--r--src/rebar_base_compiler.erl2
-rw-r--r--src/rebar_erlc_compiler.erl2
-rw-r--r--src/rebar_prv_eunit.erl2
-rw-r--r--src/rebar_templater.erl2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/rebar_base_compiler.erl b/src/rebar_base_compiler.erl
index bfd79a5..9aa7419 100644
--- a/src/rebar_base_compiler.erl
+++ b/src/rebar_base_compiler.erl
@@ -54,7 +54,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
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index d4d257f..95573fd 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -48,7 +48,7 @@
-type compile_opt() :: {recursive, boolean()}.
-define(DEFAULT_OUTDIR, "ebin").
--define(RE_PREFIX, "^(?!._)").
+-define(RE_PREFIX, "^(?!\\._)").
%% ===================================================================
%% Public API
diff --git a/src/rebar_prv_eunit.erl b/src/rebar_prv_eunit.erl
index 6fdf33e..a9db12e 100644
--- a/src/rebar_prv_eunit.erl
+++ b/src/rebar_prv_eunit.erl
@@ -18,7 +18,7 @@
%% we need to modify app_info state before compile
-define(DEPS, [lock]).
--define(DEFAULT_TEST_REGEX, "^(?!._).*\\.erl\$").
+-define(DEFAULT_TEST_REGEX, "^(?!\\._).*\\.erl\$").
%% ===================================================================
%% Public API
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl
index 7e0aae4..e64ce71 100644
--- a/src/rebar_templater.erl
+++ b/src/rebar_templater.erl
@@ -33,7 +33,7 @@
-include("rebar.hrl").
--define(TEMPLATE_RE, "^(?!._).*\\.template\$").
+-define(TEMPLATE_RE, "^(?!\\._).*\\.template\$").
%% ===================================================================
%% Public API