瀏覽代碼

Patch `rebar_base_compiler` to handle extensions with no leading dot

pull/2383/head
Pablo Costas Sánchez 4 年之前
父節點
當前提交
4230ddb633
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. +10
    -2
      src/rebar_base_compiler.erl

+ 10
- 2
src/rebar_base_compiler.erl 查看文件

@ -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),

Loading…
取消
儲存