Permalink
Browse files

Ignore subdirectories in erlydtl_compiler:compile_dir

  • Loading branch information...
1 parent 5a93e5b commit 8c5d29ff62392842e0ad15f832dc772421f24089 @asabil asabil committed Jun 22, 2011
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/erlydtl_compiler.erl
View
@@ -119,10 +119,15 @@ compile_dir(Dir, Module, Options) ->
("."++_, Acc) -> Acc;
(File, {ResultAcc, ErrorAcc}) ->
FilePath = filename:join([Dir, File]),
- case parse(FilePath, Context) of
- ok -> {ResultAcc, ErrorAcc};
- {ok, DjangoParseTree, CheckSum} -> {[{File, DjangoParseTree, CheckSum}|ResultAcc], ErrorAcc};
- Err -> {ResultAcc, [Err|ErrorAcc]}
+ case filelib:is_dir(FilePath) of
+ true ->
+ {ResultAcc, ErrorAcc};
+ false ->
+ case parse(FilePath, Context) of
+ ok -> {ResultAcc, ErrorAcc};
+ {ok, DjangoParseTree, CheckSum} -> {[{File, DjangoParseTree, CheckSum}|ResultAcc], ErrorAcc};
+ Err -> {ResultAcc, [Err|ErrorAcc]}
+ end
end
end, {[], []}, Files),
case ParserErrors of

0 comments on commit 8c5d29f

Please sign in to comment.