summaryrefslogtreecommitdiff
path: root/src/rebar_prv_lock.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_lock.erl')
-rw-r--r--src/rebar_prv_lock.erl17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/rebar_prv_lock.erl b/src/rebar_prv_lock.erl
index 4ada1ef..aba5080 100644
--- a/src/rebar_prv_lock.erl
+++ b/src/rebar_prv_lock.erl
@@ -31,22 +31,17 @@ init(State) ->
do(State) ->
case rebar_state:get(State, locks, []) of
[] ->
- AllDeps = rebar_state:get(State, all_deps, []),
+ AllDeps = rebar_state:lock(State),
Locks = lists:map(fun(Dep) ->
Dir = rebar_app_info:dir(Dep),
+ Source = rebar_app_info:source(Dep),
%% If source is tuple it is a source dep
%% e.g. {git, "git://github.com/ninenines/cowboy.git", "master"}
- case rebar_app_info:source(Dep) of
- Source when is_tuple(Source) ->
- {rebar_app_info:name(Dep)
- ,rebar_app_info:original_vsn(Dep)
- ,rebar_fetch:lock_source(Dir, Source)
- ,rebar_app_info:dep_level(Dep)};
- _Source ->
- {rebar_app_info:name(Dep)
- ,rebar_app_info:original_vsn(Dep)}
- end
+ {rebar_app_info:name(Dep)
+ ,rebar_app_info:original_vsn(Dep)
+ ,rebar_fetch:lock_source(Dir, Source)
+ ,rebar_app_info:dep_level(Dep)}
end, AllDeps),
Dir = rebar_state:dir(State),
file:write_file(filename:join(Dir, "rebar.lock"), io_lib:format("~p.~n", [Locks])),