From 54a41ca6c4fb819aa5adf4883f51d0c785a56be3 Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Sun, 21 Dec 2014 14:47:55 -0500 Subject: Tests and fixes for namespaces --- src/rebar_core.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/rebar_core.erl b/src/rebar_core.erl index cfe040a..c3a8951 100644 --- a/src/rebar_core.erl +++ b/src/rebar_core.erl @@ -54,8 +54,13 @@ process_command(State, Command) -> undefined -> %% On the first run (Namespace = undefined), we use the %% unfound command name to be a namespace. - do([{default, do} | TargetProviders], - rebar_state:namespace(State, Command)); + case providers:get_providers_by_namespace(Command, Providers) of + [] -> + {error, io_lib:format("Command ~p not found", [Command])}; + _ -> + do([{default, do} | TargetProviders], + rebar_state:namespace(State, Command)) + end; default -> {error, io_lib:format("Command ~p not found", [Command])}; _ -> -- cgit v1.1