summaryrefslogtreecommitdiff
path: root/src/rebar_packages.erl
diff options
context:
space:
mode:
authoromarkj <omarkj@gmail.com>2014-11-03 13:58:58 -0800
committeromarkj <omarkj@gmail.com>2014-11-03 13:58:58 -0800
commita1d030c9649526422f58e0fb5dae9d33564b395a (patch)
treefeb95f0fec3421ed876e1802584430e18e29f73f /src/rebar_packages.erl
parent58f4019fa62a73e335967870f6605182d7386830 (diff)
parenta3ec3a3424dd47e9687d0d2960ef2d3cba6a8f5c (diff)
add help
Diffstat (limited to 'src/rebar_packages.erl')
-rw-r--r--src/rebar_packages.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rebar_packages.erl b/src/rebar_packages.erl
index 103d3a3..cd979fa 100644
--- a/src/rebar_packages.erl
+++ b/src/rebar_packages.erl
@@ -4,7 +4,7 @@
-include("rebar.hrl").
--spec get_packages(rebar_state:t()) -> {list(), rlx_depsolver:t()}.
+-spec get_packages(rebar_state:t()) -> {rebar_dict(), rlx_depsolver:t()}.
get_packages(State) ->
RebarDir = rebar_state:get(State, global_rebar_dir, filename:join(os:getenv("HOME"), ".rebar")),
PackagesFile = filename:join(RebarDir, "packages"),
@@ -12,12 +12,13 @@ get_packages(State) ->
true ->
try
{ok, Binary} = file:read_file(PackagesFile),
- binary_to_term(Binary)
+ {Dict, Graph} = binary_to_term(Binary),
+ {Dict, Graph}
catch
_:_ ->
?ERROR("Bad packages index, try to fix with `rebar update`~n", []),
- {[], rlx_depsolver:new()}
+ {dict:new(), rlx_depsolver:new_graph()}
end;
false ->
- {[], rlx_depsolver:new()}
+ {dict:new(), rlx_depsolver:new_graph()}
end.