diff --git a/lib/vagrant/util/subprocess.rb b/lib/vagrant/util/subprocess.rb index 7802bee2e..bd5abfccf 100644 --- a/lib/vagrant/util/subprocess.rb +++ b/lib/vagrant/util/subprocess.rb @@ -73,13 +73,6 @@ module Vagrant process.io.stderr = stderr_writer process.duplex = true - # Set the environment on the process if we must - if @options[:env] - @options[:env].each do |k, v| - process.environment[k] = v - end - end - # If we're in the installer and the command is NOT included # in the installer (external), then remove the DYLD_IMPORT_PATH # environmental variable to run into linker issues. [GH-2219] @@ -94,6 +87,13 @@ module Vagrant end end + # Set the environment on the process if we must + if @options[:env] + @options[:env].each do |k, v| + process.environment[k] = v + end + end + # Start the process begin SafeChdir.safe_chdir(workdir) do