Просмотр исходного кода

Merge pull request #39 from runejuhl/fix-html-endings

Skip files ending with ~ in compile_dir
Evan Miller 12 лет назад
Родитель
Сommit
8552440b15
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/erlydtl_compiler.erl

+ 3 - 1
src/erlydtl_compiler.erl

@@ -117,7 +117,9 @@ compile_dir(Dir, Module) ->
 
 compile_dir(Dir, Module, Options) ->
     Context = init_dtl_context_dir(Dir, Module, Options),
-    Files = filelib:fold_files(Dir, ".*", true, fun(F1,Acc1) -> [F1 | Acc1] end, []),
+    %% Find all files in Dir (recursively), matching the regex (no
+    %% files ending in "~").
+    Files = filelib:fold_files(Dir, ".+[^~]$", true, fun(F1,Acc1) -> [F1 | Acc1] end, []),
     {ParserResults, ParserErrors} = lists:foldl(fun
             (File, {ResultAcc, ErrorAcc}) ->
                 case filename:basename(File) of