浏览代码

Fix grep invocations

pull/3/head
Tuncer Ayaz 14 年前
父节点
当前提交
ebcae06928
共有 2 个文件被更改,包括 23 次插入13 次删除
  1. +10
    -5
      src/rebar_erlydtl_compiler.erl
  2. +13
    -8
      src/rebar_neotoma_compiler.erl

+ 10
- 5
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 ],

+ 13
- 8
src/rebar_neotoma_compiler.erl 查看文件

@ -122,14 +122,19 @@ referenced_pegs1(Step, Config, Seen) ->
ExtMatch = re:replace(option(source_ext, NeoOpts), "\.", "\\\\\\\\.",
[{return, list}]),
AllRefs = lists:append([begin
{ok, Res} =
rebar_utils:sh(
lists:flatten(["grep -o [^\\\"]*",
ExtMatch, " ", F]),
[{use_stdout, false}]),
string:tokens(Res, "\n")
end || F <- Step]),
ShOpts = [{use_stdout, false}, return_on_error],
AllRefs =
lists:append(
[begin
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, NeoOpts),
WithPaths = [ filename:join([DocRoot, F]) || F <- AllRefs ],
Existing = [F || F <- WithPaths, filelib:is_regular(F)],

正在加载...
取消
保存