Kaynağa Gözat

templater: return error, don't throw, if git or hg fail

pull/253/head
Tristan Sloughter 10 yıl önce
ebeveyn
işleme
cb1a5b945c
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. +3
    -3
      src/rebar_templater.erl

+ 3
- 3
src/rebar_templater.erl Dosyayı Görüntüle

@ -143,9 +143,9 @@ default_variables() ->
default_author_and_email() -> default_author_and_email() ->
%% See if we can get a git user and email to use as defaults %% See if we can get a git user and email to use as defaults
case rebar_utils:sh("git config --global user.name", []) of
case rebar_utils:sh("git config --global user.name", [return_on_error]) of
{ok, Name} -> {ok, Name} ->
case rebar_utils:sh("git config --global user.email", []) of
case rebar_utils:sh("git config --global user.email", [return_on_error]) of
{ok, Email} -> {ok, Email} ->
{string:strip(Name, both, $\n), string:strip(Email, both, $\n)}; {string:strip(Name, both, $\n), string:strip(Email, both, $\n)};
{error, _} -> {error, _} ->
@ -154,7 +154,7 @@ default_author_and_email() ->
end; end;
{error, _} -> {error, _} ->
%% Ok, try mecurial %% Ok, try mecurial
case rebar_utils:sh("hg showconfig ui.username", []) of
case rebar_utils:sh("hg showconfig ui.username", [return_on_error]) of
{ok, NameEmail} -> {ok, NameEmail} ->
case re:run(NameEmail, [{capture, [1,2], list}]) of case re:run(NameEmail, [{capture, [1,2], list}]) of
{match, [Name, Email]} -> {match, [Name, Email]} ->

Yükleniyor…
İptal
Kaydet