diff options
author | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-04-22 21:53:32 +0200 |
---|---|---|
committer | Tuncer Ayaz <tuncer.ayaz@gmail.com> | 2012-07-13 15:21:56 +0200 |
commit | e185e86bff17fa7d093f8b24fcc45069ffde55ae (patch) | |
tree | 08cbdc29922bc67d691f21be9d76d7a5c8d4c668 /src/rebar.erl | |
parent | 1948eb4a47c1aa61aebbd046aa951f103a1f8644 (diff) |
Remove shared state
Diffstat (limited to 'src/rebar.erl')
-rw-r--r-- | src/rebar.erl | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/rebar.erl b/src/rebar.erl index 0b7602b..5812170 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -103,9 +103,6 @@ run_aux(Commands) -> %% Initialize logging system rebar_log:init(), - %% Initialize vsn cache - _VsnCacheTab = ets:new(rebar_vsn_cache,[named_table, public]), - %% Convert command strings to atoms CommandAtoms = [list_to_atom(C) || C <- Commands], @@ -118,9 +115,6 @@ run_aux(Commands) -> %% Note the top-level directory for reference rebar_config:set_global(base_dir, filename:absname(rebar_utils:get_cwd())), - %% Keep track of how many operations we do, so we can detect bad commands - erlang:put(operations, 0), - %% If $HOME/.rebar/config exists load and use as global config GlobalConfigFile = filename:join([os:getenv("HOME"), ".rebar", "config"]), GlobalConfig = case filelib:is_regular(GlobalConfigFile) of @@ -133,8 +127,13 @@ run_aux(Commands) -> end, BaseConfig = rebar_config:base_config(GlobalConfig), + %% Keep track of how many operations we do, so we can detect bad commands + BaseConfig1 = rebar_config:set_xconf(BaseConfig, operations, 0), + %% Initialize vsn cache + BaseConfig2 = rebar_config:set_xconf(BaseConfig1, vsn_cache, dict:new()), + %% Process each command, resetting any state between each one - rebar_core:process_commands(CommandAtoms, BaseConfig). + rebar_core:process_commands(CommandAtoms, BaseConfig2). %% %% print help/usage string |