summaryrefslogtreecommitdiff
path: root/src/rebar_lock.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_lock.erl')
-rw-r--r--src/rebar_lock.erl13
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])).