Group :: Development/Erlang
RPM: rebar
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: rebar-add-ignore-cmd-list.patch
Download
Download
src/rebar_core.erl | 52 +++++++++++++++++++++++++++++++++-------------------
1 file changed, 33 insertions(+), 19 deletions(-)
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 56b32f2..0ae4b9f 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -309,29 +309,35 @@ execute(Command, Modules, Config, ModuleFile) ->
TargetModules ->
%% Provide some info on where we are
Dir = rebar_utils:get_cwd(),
- ?CONSOLE("==> ~s (~s)\n", [filename:basename(Dir), Command]),
+ ModuleName = filename:basename(Dir),
+ ?CONSOLE("==> ~s (~s)\n", [ModuleName, Command]),
increment_operations(),
- %% Check for and get command specific environments
- Env = setup_envs(Config, Modules),
- %% Run the available modules
- apply_hooks(pre_hooks, Config, Command, Env),
- case catch(run_modules(TargetModules, Command,
- Config, ModuleFile)) of
- ok ->
- apply_hooks(post_hooks, Config, Command, Env),
- ok;
- {error, failed} ->
- ?FAIL;
- {Module, {error, _} = Other} ->
- ?ABORT("~p failed while processing ~s in module ~s: ~s\n",
- [Command, Dir, Module,
- io_lib:print(Other, 1, 80, -1)]);
- Other ->
- ?ABORT("~p failed while processing ~s: ~s\n",
- [Command, Dir, io_lib:print(Other, 1, 80, -1)])
+ case ignore_execute(Config, Command, erlang:list_to_atom(ModuleName)) of
+ true ->
+ ?CONSOLE("Ignore command \"~p\" for module ~p~n", [Command, ModuleName]);
+ false ->
+ %% Check for and get command specific environments
+ Env = setup_envs(Config, Modules),
+ %% Run the available modules
+ apply_hooks(pre_hooks, Config, Command, Env),
+ case catch(run_modules(TargetModules, Command,
+ Config, ModuleFile)) of
+ ok ->
+ apply_hooks(post_hooks, Config, Command, Env),
+ ok;
+ {error, failed} ->
+ ?FAIL;
+ {Module, {error, _} = Other} ->
+ ?ABORT("~p failed while processing ~s in module ~s: ~s\n",
+ [Command, Dir, Module,
+ io_lib:print(Other, 1, 80, -1)]);
+ Other ->
+ ?ABORT("~p failed while processing ~s: ~s\n",
+ [Command, Dir, io_lib:print(Other, 1, 80, -1)])
+ end
end
end.
@@ -340,6 +346,14 @@ execute(Command, Modules, Config, ModuleFile) ->
increment_operations() ->
erlang:put(operations, erlang:get(operations) + 1).
+ignore_execute(Config, Command, ModuleName) ->
+ lists:member(
+ ModuleName,
+ proplists:get_value(
+ Command,
+ lists:flatten(rebar_config:get_all(Config, ignore_cmd)),
+ [])
+ ).
update_code_path(Config) ->
case rebar_config:get_local(Config, lib_dirs, []) of