diff options
author | Juhani Rankimies <juhani@juranki.com> | 2010-12-05 02:07:12 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2011-01-06 15:02:19 +0100 |
commit | 52ca7795feb001f0624ec87e717e3019f8a810bd (patch) | |
tree | e66560012ae9789dfaa9d1822d19deff4676f679 /src/rebar_neotoma_compiler.erl | |
parent | f7eb0a71589ec4ebee1315fe2f430d8af607aa36 (diff) | |
download | rebar-52ca7795feb001f0624ec87e717e3019f8a810bd.tar.gz |
Unify executable invocation
Add flags to rebar_utils:sh to control output and error handling.
Replace calls to os:cmd with calls to rebar_utils:sh.
Diffstat (limited to 'src/rebar_neotoma_compiler.erl')
-rw-r--r-- | src/rebar_neotoma_compiler.erl | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rebar_neotoma_compiler.erl b/src/rebar_neotoma_compiler.erl index 89cd089..c2e6f0d 100644 --- a/src/rebar_neotoma_compiler.erl +++ b/src/rebar_neotoma_compiler.erl @@ -121,11 +121,16 @@ 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]), + 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, NeoOpts), WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ], Existing = [F || F <- WithPaths, filelib:is_file(F)], |