diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-08-28 09:17:01 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-08-28 09:17:01 -0500 |
commit | 393abe92d01040a847bfc42a80d61b33f0254ca7 (patch) | |
tree | 2441809c82d2dc5fe4ac4c818b6714221a0915e2 /src/rebar_lock.erl | |
parent | 97db15d2a58de542aaef4075cddc3769f0308759 (diff) |
use locks if exists
Diffstat (limited to 'src/rebar_lock.erl')
-rw-r--r-- | src/rebar_lock.erl | 10 |
1 files changed, 2 insertions, 8 deletions
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])). |