Skip to content

Commit

Permalink
Merge pull request #13 from tillitech/master
Browse files Browse the repository at this point in the history
Ignore subdirectories in erlydtl_compiler:compile_dir
  • Loading branch information
evanmiller committed Jun 22, 2011
2 parents 5a93e5b + 8c5d29f commit 6a3c8f2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/erlydtl_compiler.erl
Expand Up @@ -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
Expand Down

0 comments on commit 6a3c8f2

Please sign in to comment.