diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-08-13 18:59:47 -0500 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-08-13 19:00:06 -0500 |
commit | aac4fa0e3cc86b354d93145d225b4404c97e1c28 (patch) | |
tree | 31c37ca7538a7bd32511c74c439d33d8b19cb952 /src | |
parent | ab92f1a2925fc69215d1355a6a8ec263c3e36007 (diff) |
only lock when running in the default profile
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_lock.erl | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/rebar_prv_lock.erl b/src/rebar_prv_lock.erl index 80ac784..8578979 100644 --- a/src/rebar_prv_lock.erl +++ b/src/rebar_prv_lock.erl @@ -29,18 +29,24 @@ init(State) -> -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> - OldLocks = rebar_state:get(State, {locks, default}, []), - Locks = lists:keysort(1, build_locks(State)), - Dir = rebar_state:dir(State), - file:write_file(filename:join(Dir, ?LOCK_FILE), - io_lib:format("~p.~n", [Locks])), - State1 = rebar_state:set(State, {locks, default}, Locks), + %% Only lock default profile run + case rebar_state:current_profiles(State) of + [default] -> + OldLocks = rebar_state:get(State, {locks, default}, []), + Locks = lists:keysort(1, build_locks(State)), + Dir = rebar_state:dir(State), + file:write_file(filename:join(Dir, ?LOCK_FILE), + io_lib:format("~p.~n", [Locks])), + State1 = rebar_state:set(State, {locks, default}, Locks), - OldLockNames = [element(1,L) || L <- OldLocks], - NewLockNames = [element(1,L) || L <- Locks], - rebar_utils:info_useless(OldLockNames, NewLockNames), + OldLockNames = [element(1,L) || L <- OldLocks], + NewLockNames = [element(1,L) || L <- Locks], + rebar_utils:info_useless(OldLockNames, NewLockNames), - {ok, State1}. + {ok, State1}; + _ -> + {ok, State} + end. -spec format_error(any()) -> iolist(). format_error(Reason) -> |