diff options
Diffstat (limited to 'src/rebar_erlydtl_compiler.erl')
-rw-r--r-- | src/rebar_erlydtl_compiler.erl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl index aa017ce..6b2160c 100644 --- a/src/rebar_erlydtl_compiler.erl +++ b/src/rebar_erlydtl_compiler.erl @@ -162,11 +162,16 @@ referenced_dtls1(Step, Config, Seen) -> DtlOpts = erlydtl_opts(Config), ExtMatch = re:replace(option(source_ext, DtlOpts), "\.", "\\\\\\\\.", [{return, list}]), - AllRefs = lists:append( - [string:tokens( - os:cmd(["grep -o [^\\\"]*",ExtMatch," ",F]), - "\n") - || F <- Step]), + AllRefs = + lists:append( + lists:map( + fun(F) -> + {ok, Res} = rebar_utils:sh( + lists:flatten(["grep -o [^\\\"]*", + ExtMatch," ",F]), + [{use_stdout, false}]), + string:tokens(Res, "\n") + end, Step)), DocRoot = option(doc_root, DtlOpts), WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ], Existing = [F || F <- WithPaths, filelib:is_file(F)], @@ -176,4 +181,3 @@ referenced_dtls1(Step, Config, Seen) -> _ -> referenced_dtls1(sets:to_list(New), Config, sets:union(New, Seen)) end. - |