diff --git a/Capfile.repos b/Capfile.repos index 1242ff6..dce7f1f 100644 --- a/Capfile.repos +++ b/Capfile.repos @@ -4,4 +4,20 @@ colorize [ { :match => /executing command/, :color => :blue, :prio => 10, :attribute => :underscore }, { :match => /^transaction: commit$/, :color => :magenta, :prio => 10, :attribute => :blink }, { :match => /git/, :color => :white, :prio => 20, :attribute => :reverse }, -] \ No newline at end of file +] + +on :load do + # MonkeyPatch run_locally so that we use Bundler.with_clean_env + # logs the command then executes it locally. + + # returns the command output as a string + def run_locally_with_bundler_clean_env(cmd) + Bundler.with_clean_env do + run_locally_without_bundler_clean_env(cmd) + end + end + + alias run_locally_without_bundler_clean_env run_locally + alias run_locally run_locally_with_bundler_clean_env + +end