diff options
author | Eric <[email protected]> | 2013-01-24 21:03:53 -0800 |
---|---|---|
committer | Eric <[email protected]> | 2013-01-24 21:03:53 -0800 |
commit | 6c90453d79cd1e8cf35cb4f6ad4ee51d7be39e50 (patch) | |
tree | dec64fc42b184decdeb92a75805a88da622bd72d /src/rcl_state.erl | |
parent | e02d59de76a2f0c0e0311f22e4779652a1375ee9 (diff) | |
download | relx-6c90453d79cd1e8cf35cb4f6ad4ee51d7be39e50.tar.gz relx-6c90453d79cd1e8cf35cb4f6ad4ee51d7be39e50.tar.bz2 relx-6c90453d79cd1e8cf35cb4f6ad4ee51d7be39e50.zip |
convert relcool to take a config as a opt argument
adds `-c <config-file>` or `--config <config-file>` instead of passing
the config file as an argument.
Diffstat (limited to 'src/rcl_state.erl')
-rw-r--r-- | src/rcl_state.erl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rcl_state.erl b/src/rcl_state.erl index a2e6c66..ecf3115 100644 --- a/src/rcl_state.erl +++ b/src/rcl_state.erl @@ -62,6 +62,7 @@ -record(state_t, {log :: rcl_log:t(), root_dir :: file:name(), caller :: caller(), + action :: atom(), output_dir :: file:name(), lib_dirs=[] :: [file:name()], config_file=[] :: file:filename(), @@ -92,14 +93,17 @@ %% API %%============================================================================ %% @doc Create a new 'log level' for the system --spec new(proplists:proplist(), [file:filename()] | file:filename()) -> t(). -new(PropList, Target) when erlang:is_list(PropList) -> +-spec new(proplists:proplist(), atom()) -> t(). +new(PropList, Target) + when erlang:is_list(PropList), + erlang:is_atom(Target) -> {ok, Root} = file:get_cwd(), State0 = #state_t{log = proplists:get_value(log, PropList, rcl_log:new(error)), output_dir=proplists:get_value(output_dir, PropList, ""), lib_dirs=proplists:get_value(lib_dirs, PropList, ""), - config_file=Target, + config_file=proplists:get_value(config, PropList, ""), + action = Target, goals=proplists:get_value(goals, PropList, []), providers = [], releases=ec_dictionary:new(ec_dict), @@ -286,7 +290,7 @@ create_logic_providers(State0) -> new_test() -> LogState = rcl_log:new(error), - RCLState = new([{log, LogState}], []), + RCLState = new([{log, LogState}], release), ?assertMatch(LogState, log(RCLState)). -endif. |