diff options
Diffstat (limited to 'src/rebar_erlydtl_compiler.erl')
-rw-r--r-- | src/rebar_erlydtl_compiler.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rebar_erlydtl_compiler.erl b/src/rebar_erlydtl_compiler.erl index d30b56c..35a548d 100644 --- a/src/rebar_erlydtl_compiler.erl +++ b/src/rebar_erlydtl_compiler.erl @@ -162,14 +162,19 @@ referenced_dtls1(Step, Config, Seen) -> DtlOpts = erlydtl_opts(Config), ExtMatch = re:replace(option(source_ext, DtlOpts), "\.", "\\\\\\\\.", [{return, list}]), + + ShOpts = [{use_stdout, false}, return_on_error], AllRefs = lists:append( [begin - {ok, Res} = rebar_utils:sh( - lists:flatten(["grep -o [^\\\"]*", - ExtMatch," ",F]), - [{use_stdout, false}]), - string:tokens(Res, "\n") + Cmd = lists:flatten(["grep -o [^\\\"]*", + ExtMatch, " ", F]), + case rebar_utils:sh(Cmd, ShOpts) of + {ok, Res} -> + string:tokens(Res, "\n"); + {error, _} -> + "" + end end || F <- Step]), DocRoot = option(doc_root, DtlOpts), WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ], |