diff options
Diffstat (limited to 'src/rebar_neotoma_compiler.erl')
-rw-r--r-- | src/rebar_neotoma_compiler.erl | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/rebar_neotoma_compiler.erl b/src/rebar_neotoma_compiler.erl index 586b102..89cd089 100644 --- a/src/rebar_neotoma_compiler.erl +++ b/src/rebar_neotoma_compiler.erl @@ -108,31 +108,27 @@ do_compile(Source, _Target, Config) -> needs_compile(Source, Target, Config) -> LM = filelib:last_modified(Target), - case LM < filelib:last_modified(Source) of - true -> true; - false -> - lists:any(fun(D) -> LM < filelib:last_modified(D) end, - referenced_pegs(Source, Config)) - end. + LM < filelib:last_modified(Source) orelse + lists:any(fun(D) -> LM < filelib:last_modified(D) end, + referenced_pegs(Source, Config)). referenced_pegs(Source, Config) -> Set = referenced_pegs1([Source], Config, sets:add_element(Source, sets:new())), - Final = sets:to_list(sets:del_element(Source, Set)), - Final. + sets:to_list(sets:del_element(Source, Set)). referenced_pegs1(Step, Config, Seen) -> NeoOpts = neotoma_opts(Config), ExtMatch = re:replace(option(source_ext, NeoOpts), "\.", "\\\\\\\\.", [{return, list}]), AllRefs = lists:append( - [ string:tokens( - os:cmd(["grep -o [^\\\"]*",ExtMatch," ",F]), - "\n") - || F <- Step]), + [string:tokens( + os:cmd(["grep -o [^\\\"]*",ExtMatch," ",F]), + "\n") + || F <- Step]), DocRoot = option(doc_root, NeoOpts), WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ], - Existing = lists:filter(fun filelib:is_file/1, WithPaths), + Existing = [F || F <- WithPaths, filelib:is_file(F)], New = sets:subtract(sets:from_list(Existing), Seen), case sets:size(New) of 0 -> Seen; |