Bläddra i källkod

Merge pull request #2383 from pablocostass/2378_patch_compiler_leading_dot

Patch `rebar_base_compiler` to handle extensions with no leading dot
pull/2386/head
Fred Hebert 4 år sedan
committed by GitHub
förälder
incheckning
7700dc25f2
Ingen känd nyckel hittad för denna signaturen i databasen GPG-nyckel ID: 4AEE18F83AFDEB23
1 ändrade filer med 10 tillägg och 2 borttagningar
  1. +10
    -2
      src/rebar_base_compiler.erl

+ 10
- 2
src/rebar_base_compiler.erl Visa fil

@ -96,9 +96,17 @@ run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt,
TargetDir :: file:filename(),
SourceExt :: string(),
TargetExt :: string().
run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt,
run(Config, FirstFiles, SourceDir, SourceExt0, TargetDir, TargetExt,
Compile3Fn, Opts) ->
%% Convert simple extension to proper regex
%% Convert simple extension to proper regex.
%% If the extension has a leading dot (e.g.: `.peg')
%% we escape it.
%% Otherwise, if the extension doesn't have a leading dot
%% we add it ourselves (e.g.: `peg' -> `.peg')
SourceExt = case SourceExt0 of
[$.|_Ext] -> SourceExt0;
_ -> [$.] ++ SourceExt0
end,
SourceExtRe = "^(?!\\._).*\\" ++ SourceExt ++ [$$],
Recursive = proplists:get_value(recursive, Opts, true),

Laddar…
Avbryt
Spara