From dadf725074d2c95bc703d255f6af3cb59c4644b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eloy=20Dur=C3=A1n?= Date: Thu, 11 Dec 2014 21:03:08 +0100 Subject: [PATCH] [Target] Always use a clean bundler env when using bundler. --- lib/motion/project/target.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/motion/project/target.rb b/lib/motion/project/target.rb index 861ef472..505bd28e 100644 --- a/lib/motion/project/target.rb +++ b/lib/motion/project/target.rb @@ -122,8 +122,16 @@ module Motion; module Project env_description = env.map { |k,v| "#{k}='#{v}'" }.join(' ') puts "cd '#{@full_path}' && env #{env_description} #{command}" end - Dir.chdir(@full_path) do - super(env, command) + if use_gemfile? + Bundler.with_clean_env do + Dir.chdir(@full_path) do + super(env, command) + end + end + else + Dir.chdir(@full_path) do + super(env, command) + end end end