From 393abe92d01040a847bfc42a80d61b33f0254ca7 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 28 Aug 2014 09:17:01 -0500 Subject: use locks if exists --- src/rebar_lock.erl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/rebar_lock.erl') diff --git a/src/rebar_lock.erl b/src/rebar_lock.erl index a973ccc..2a54600 100644 --- a/src/rebar_lock.erl +++ b/src/rebar_lock.erl @@ -1,13 +1,7 @@ -module(rebar_lock). --export([update/3]). +-export([create/1]). create(State) -> - LockDeps = [], - ok = file:write_file("./rebar.lock", io_lib:format("~p.~n", [LockDeps])). - -update(State, App, Source) -> - New = rebar_fetch:new(rebar_app_info:dir(App), rebar_app_info:name(App), rebar_app_info:original_vsn(App), Source), - {ok, [Terms]} = file:consult("./rebar.lock"), - LockDeps = lists:keyreplace(rebar_app_info:name(App), 1, Terms, New), + LockDeps = rebar_state:get(State, locks, []), ok = file:write_file("./rebar.lock", io_lib:format("~p.~n", [LockDeps])). -- cgit v1.1