Skip to content

Instantly share code, notes, and snippets.

@yfyf
Created November 23, 2012 11:25
Show Gist options
  • Save yfyf/4135204 to your computer and use it in GitHub Desktop.
Save yfyf/4135204 to your computer and use it in GitHub Desktop.
execute rebar plugin when explicit only
-module(foobar_rebar_plugin).
-export([
pre_compile/2
]).
pre_compile(Config, AppFile) ->
case is_explicit_plugin(Config) of
true ->
%% Do Stuff.
false ->
ok
end.
is_explicit_plugin(Config) ->
lists:member(?MODULE, lists:flatten(rebar_config:get_local(Config, plugins, []))).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment