diff options
author | Tristan Sloughter <t@crashfast.com> | 2016-02-21 09:47:31 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2016-02-21 09:47:31 -0600 |
commit | 862486cac743174b6a3a2ffb487dc851ea97020a (patch) | |
tree | ae01a72905fbfa81fa8fd0c4ac5bbbf4f717698c /src/rebar_prv_unlock.erl | |
parent | e3437c1dfbb170fe07793004738c29963b887466 (diff) | |
parent | caf4468f3bbbea75be35e0cf0560990b5db66e7e (diff) |
Merge pull request #1061 from ferd/future-proof-lockfiles
Make lock files future-proof
Diffstat (limited to 'src/rebar_prv_unlock.erl')
-rw-r--r-- | src/rebar_prv_unlock.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rebar_prv_unlock.erl b/src/rebar_prv_unlock.erl index b049c92..7ff0d89 100644 --- a/src/rebar_prv_unlock.erl +++ b/src/rebar_prv_unlock.erl @@ -46,15 +46,14 @@ do(State) -> {ok, State}; {error, Reason} -> ?PRV_ERROR({file,Reason}); - {ok, [Locks]} -> + {ok, _} -> + Locks = rebar_config:consult_lock_file(LockFile), case handle_unlocks(State, Locks, LockFile) of ok -> {ok, State}; {error, Reason} -> ?PRV_ERROR({file,Reason}) - end; - {ok, _Other} -> - ?PRV_ERROR(unknown_lock_format) + end end. -spec format_error(any()) -> iolist(). @@ -74,7 +73,7 @@ handle_unlocks(State, Locks, LockFile) -> _ when Names =:= [] -> % implicitly all locks file:delete(LockFile); NewLocks -> - file:write_file(LockFile, io_lib:format("~p.~n", [NewLocks])) + rebar_config:write_lock_file(LockFile, NewLocks) end. parse_names(Bin) -> |