Permalink
Browse files

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

Skip files ending with ~ in compile_dir
  • Loading branch information...
2 parents 8797a29 + 7595a2d commit 8552440b15f6f8dc80233d10ff1d366ac84a58ad @evanmiller evanmiller committed Aug 16, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/erlydtl_compiler.erl
View
4 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

0 comments on commit 8552440

Please sign in to comment.