Skip to content

Commit 5ff9c80

Browse files
Improve on previous fix (#32)
1 parent c1ef3ac commit 5ff9c80

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/dep_updater.erl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ maybe_update_hex_dep(Vsn, Package, Opts) ->
8080
end.
8181

8282
%% NOTE: This function only updates git deps when they use valid semver tags.
83-
maybe_update_git_dep(Name, {git, Repo, {tag, Vsn}}, _Dep, Opts) ->
83+
maybe_update_git_dep(Name, {git, Repo, {tag, Vsn}}, Dep, Opts) ->
8484
GitCmd =
8585
lists:flatten(
8686
io_lib:format("git -c 'versionsort.suffix=-' ls-remote --refs --tags ~p '*.*.*'",
8787
[Repo])),
8888
LatestVsn =
89-
case rebar_utils:sh(GitCmd, [use_stdout]) of
89+
case rebar_utils:sh(GitCmd, [return_on_error]) of
9090
{ok, ""} ->
9191
rebar_api:info("Latest version for ~p not found, keeping ~ts", [Name, Vsn]),
9292
Vsn;
@@ -97,7 +97,10 @@ maybe_update_git_dep(Name, {git, Repo, {tag, Vsn}}, _Dep, Opts) ->
9797
NewVsn =
9898
lists:last(
9999
string:tokens(LastTag, [$/])),
100-
latest_version(Name, Vsn, iolist_to_binary(NewVsn), Opts)
100+
latest_version(Name, Vsn, iolist_to_binary(NewVsn), Opts);
101+
{error, {_Code, Msg}} ->
102+
rebar_api:warn(Msg ++ "===> Skipping ~p", [Name]),
103+
Dep
101104
end,
102105
{Name, {git, Repo, {tag, LatestVsn}}};
103106
maybe_update_git_dep(Name, _Source, Dep, _Opts) ->

0 commit comments

Comments
 (0)