Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ignore subdirectories in erlydtl_compiler:compile_dir

  • Loading branch information...
commit 8c5d29ff62392842e0ad15f832dc772421f24089 1 parent 5a93e5b
Ali Sabil asabil authored
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/erlydtl_compiler.erl
13 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
Please sign in to comment.
Something went wrong with that request. Please try again.