diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-08-17 21:10:43 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-08-17 21:10:43 -0500 |
commit | 629792f36baaaddaeb8ce654760ca4392a571cc5 (patch) | |
tree | b8332107bf24ee9612123ab7c03939da58085290 /src/rebar_lock.erl | |
parent | 54e1231e4f34e3bcb9ccdbbd07565fe2538c5401 (diff) |
start of moving to splitting state from config parsing
Diffstat (limited to 'src/rebar_lock.erl')
-rw-r--r-- | src/rebar_lock.erl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/rebar_lock.erl b/src/rebar_lock.erl new file mode 100644 index 0000000..a973ccc --- /dev/null +++ b/src/rebar_lock.erl @@ -0,0 +1,13 @@ +-module(rebar_lock). + +-export([update/3]). + +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), + ok = file:write_file("./rebar.lock", io_lib:format("~p.~n", [LockDeps])). |