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_reltool.erl | |
parent | 1948eb4a47c1aa61aebbd046aa951f103a1f8644 (diff) | |
download | rebar-e185e86bff17fa7d093f8b24fcc45069ffde55ae.tar.gz |
Remove shared state
Diffstat (limited to 'src/rebar_reltool.erl')
-rw-r--r-- | src/rebar_reltool.erl | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rebar_reltool.erl b/src/rebar_reltool.erl index 06411da..c8e8cb6 100644 --- a/src/rebar_reltool.erl +++ b/src/rebar_reltool.erl @@ -37,12 +37,12 @@ %% Public API %% =================================================================== -generate(Config, ReltoolFile) -> +generate(Config0, ReltoolFile) -> %% Make sure we have decent version of reltool available check_vsn(), %% Load the reltool configuration from the file - ReltoolConfig = rebar_rel_utils:load_config(ReltoolFile), + {Config, ReltoolConfig} = rebar_rel_utils:load_config(Config0, ReltoolFile), Sys = rebar_rel_utils:get_sys_tuple(ReltoolConfig), @@ -56,7 +56,7 @@ generate(Config, ReltoolFile) -> %% Finally, run reltool case catch(run_reltool(Server, Config, ReltoolConfig)) of ok -> - ok; + {ok, Config}; {error, failed} -> ?ABORT; Other2 -> @@ -64,18 +64,17 @@ generate(Config, ReltoolFile) -> ?ABORT end. -overlay(_Config, ReltoolFile) -> +overlay(Config, ReltoolFile) -> %% Load the reltool configuration from the file - ReltoolConfig = rebar_rel_utils:load_config(ReltoolFile), - process_overlay(ReltoolConfig). + {Config1, ReltoolConfig} = rebar_rel_utils:load_config(Config, ReltoolFile), + {Config1, process_overlay(ReltoolConfig)}. -clean(_Config, ReltoolFile) -> - ReltoolConfig = rebar_rel_utils:load_config(ReltoolFile), +clean(Config, ReltoolFile) -> + {Config1, ReltoolConfig} = rebar_rel_utils:load_config(Config, ReltoolFile), TargetDir = rebar_rel_utils:get_target_dir(ReltoolConfig), rebar_file_utils:rm_rf(TargetDir), - rebar_file_utils:delete_each(["reltool.spec"]). - - + rebar_file_utils:delete_each(["reltool.spec"]), + {ok, Config1}. %% =================================================================== %% Internal functions |