Skip to content

Commit

Permalink
Ignore subdirectories in erlydtl_compiler:compile_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Sabil committed Jun 22, 2011
1 parent 5a93e5b commit 8c5d29f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/erlydtl_compiler.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -119,10 +119,15 @@ compile_dir(Dir, Module, Options) ->
("."++_, Acc) -> Acc; ("."++_, Acc) -> Acc;
(File, {ResultAcc, ErrorAcc}) -> (File, {ResultAcc, ErrorAcc}) ->
FilePath = filename:join([Dir, File]), FilePath = filename:join([Dir, File]),
case parse(FilePath, Context) of case filelib:is_dir(FilePath) of
ok -> {ResultAcc, ErrorAcc}; true ->
{ok, DjangoParseTree, CheckSum} -> {[{File, DjangoParseTree, CheckSum}|ResultAcc], ErrorAcc}; {ResultAcc, ErrorAcc};
Err -> {ResultAcc, [Err|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
end, {[], []}, Files), end, {[], []}, Files),
case ParserErrors of case ParserErrors of
Expand Down

0 comments on commit 8c5d29f

Please sign in to comment.