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