소스 검색

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

불러오는 중...
취소
저장