Skip to content

Commit

Permalink
Merge pull request #783 from tsloughter/sync-dev-modes
Browse files Browse the repository at this point in the history
toggle mode when changing dev_mode to false/true
  • Loading branch information
tsloughter authored Apr 18, 2020
2 parents 9d8e7ff + 5ca2ec5 commit e3b61cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rlx_state.erl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
%% `dev_mode' is for backwards compatibility
dev_mode=false :: boolean(),
%% mode toggles multiple configuration values at once
mode=prod :: mode(),
mode=prod :: mode() | undefined,

%% default check is for sasl 3.5 and above
%% version 3.5 of sasl has systools with changes for relx
Expand Down Expand Up @@ -296,6 +296,12 @@ dev_mode(#state_t{dev_mode=DevMode}) ->
DevMode.

-spec dev_mode(t(), boolean()) -> t().
dev_mode(S=#state_t{mode=dev}, false) ->
S#state_t{dev_mode=false,
mode=undefined};
dev_mode(S, true) ->
S#state_t{dev_mode=false,
mode=dev};
dev_mode(S, DevMode) ->
S#state_t{dev_mode=DevMode}.

Expand Down

0 comments on commit e3b61cd

Please sign in to comment.