From 328d1aa8afde4c9c2e6b9f02512e185163b32eef Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Mon, 8 May 2017 15:22:23 -0700 Subject: [PATCH] Disable verbose output accessing PATH --- lib/vagrant/util/which.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/util/which.rb b/lib/vagrant/util/which.rb index 9a7ba5b23..12a07f327 100644 --- a/lib/vagrant/util/which.rb +++ b/lib/vagrant/util/which.rb @@ -29,11 +29,17 @@ module Vagrant exts = ENV['PATHEXT'].split(';') end - ENV['PATH'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').split(File::PATH_SEPARATOR).each do |path| - exts.each do |ext| - exe = "#{path}#{File::SEPARATOR}#{cmd}#{ext}" - return exe if File.executable? exe + current_verbose = $VERBOSE + $VERBOSE = nil + begin + ENV['PATH'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').split(File::PATH_SEPARATOR).each do |path| + exts.each do |ext| + exe = "#{path}#{File::SEPARATOR}#{cmd}#{ext}" + return exe if File.executable? exe + end end + ensure + $VERBOSE = current_verbose end return nil