diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-09 17:52:41 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-09 17:52:41 +0100 |
| commit | 74bdd2d27cff3e43ad4fa760161ce19d3e8cbd81 (patch) | |
| tree | a2f198dcb6e4562faf0629971c64a13f3b7b0006 /src | |
| parent | 3330b3a2f392dc8a8f3567b6d4f7e9e54e579dc3 (diff) | |
| download | rabbitmq-server-git-74bdd2d27cff3e43ad4fa760161ce19d3e8cbd81.tar.gz | |
actually enable plugins
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugin.erl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rabbit_plugin.erl b/src/rabbit_plugin.erl index a95a191daa..b5bba917dc 100644 --- a/src/rabbit_plugin.erl +++ b/src/rabbit_plugin.erl @@ -104,9 +104,17 @@ action(enable, ToEnable, _Opts, PluginsDir, PluginsDistDir) -> io:format("Marked for enabling: ~p~n", [EnableOrder]), EnableOrderPlugins = [Plugin || Plugin = #plugin{name = Name} <- AllPlugins, lists:member(Name, EnableOrder)], - ok = lists:foldl(fun (#plugin{name = Name}, ok) -> - io:format("Enabling ~p~n", [Name]) - end, ok, EnableOrderPlugins), + ok = lists:foldl( + fun (#plugin{name = Name, version = Version, location = Path}, ok) -> + io:format("Enabling ~w-~s~n", [Name, Version]), + case file:copy(Path, filename:join(PluginsDir, + filename:basename(Path))) of + {ok, _Bytes} -> ok; + {error, Reason} -> io:format("Error enabling ~p (~p)~n", + [Name, Reason]), + rabbit_misc:quit(2) + end + end, ok, EnableOrderPlugins), update_enabled_plugins(Found). %%---------------------------------------------------------------------------- |
