diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-09 12:11:54 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-09 12:11:54 +0100 |
| commit | aaa1c65236c48b856a6c900b74621777a785c18b (patch) | |
| tree | 465b9da3dc2dc1bebf2bb5ba407b1d5be0efad90 /src | |
| parent | ab2f7d3b940f8ab13287faa5057d6047a58abcf4 (diff) | |
| download | rabbitmq-server-git-aaa1c65236c48b856a6c900b74621777a785c18b.tar.gz | |
pass PLUGINS_DIR and PLUGINS_DIST_DIR to rabbitmq-plugin
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_plugin.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rabbit_plugin.erl b/src/rabbit_plugin.erl index b271652bee..9120d47076 100644 --- a/src/rabbit_plugin.erl +++ b/src/rabbit_plugin.erl @@ -33,6 +33,8 @@ %%---------------------------------------------------------------------------- start() -> + {ok, [[PluginsDir|_]|_]} = init:get_argument(plugins_dir), + {ok, [[PluginsDistDir|_]|_]} = init:get_argument(plugins_dist_dir), {[Command0 | Args], Opts} = case rabbit_misc:get_options([{flag, ?FORCE_OPT}], init:get_plain_arguments()) of @@ -41,7 +43,7 @@ start() -> end, Command = list_to_atom(Command0), - case catch action(Command, Args, Opts) of + case catch action(Command, Args, Opts, PluginsDir, PluginsDistDir) of ok -> rabbit_misc:quit(0); {'EXIT', {function_clause, [{?MODULE, action, _} | _]}} -> @@ -68,5 +70,10 @@ usage() -> %%---------------------------------------------------------------------------- -action(test, [], _Opts) -> - io:format("Test ok~n"). +action(list, [], _Opts, PluginsDir, PluginsDistDir) -> + io:format("All plugins: ~p~n", [find_available_plugins(PluginsDistDir)]). + +%%---------------------------------------------------------------------------- + +find_available_plugins(PluginsDistDir) -> + filelib:wildcard("*.ez", PluginsDistDir). |
