Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

agner versions is now aware of the fact that package might be not found

  • Loading branch information...
commit f69dcb7d46d376c33720b9ddec06a6d9becc6878 1 parent b8b3e05
@yrashk yrashk authored
Showing with 14 additions and 8 deletions.
  1. BIN  rebar
  2. +14 −8 src/agner_main.erl
View
BIN  rebar
Binary file not shown
View
22 src/agner_main.erl
@@ -253,14 +253,20 @@ handle_command(versions, Opts) ->
Package ->
NoFlavours = proplists:get_value(no_flavours, Opts),
NoReleases = proplists:get_value(no_releases, Opts),
- io:format("~s",[lists:usort(plists:map(fun ({flavour, _} = Version) when not NoFlavours ->
- io_lib:format("~s~n",[agner_spec:version_to_list(Version)]);
- ({release, _} = Version) when not NoReleases ->
- io_lib:format("~s~n",[agner_spec:version_to_list(Version)]);
- (_) ->
- ""
- end,
- agner:versions(Package)))])
+ case agner:versions(Package) of
+ {error, not_found} ->
+ format_error({not_found, "Package not found"}),
+ {error, 1};
+ Versions ->
+ io:format("~s",[lists:usort(plists:map(fun ({flavour, _} = Version) when not NoFlavours ->
+ io_lib:format("~s~n",[agner_spec:version_to_list(Version)]);
+ ({release, _} = Version) when not NoReleases ->
+ io_lib:format("~s~n",[agner_spec:version_to_list(Version)]);
+ (_) ->
+ ""
+ end,
+ Versions))])
+ end
end;
handle_command(search, Opts) ->
Please sign in to comment.
Something went wrong with that request. Please try again.