Disable verbose output accessing PATH

This commit is contained in:
Chris Roberts 2017-05-08 15:22:23 -07:00
parent e8e38a4007
commit 328d1aa8af
1 changed files with 10 additions and 4 deletions

View File

@ -29,11 +29,17 @@ module Vagrant
exts = ENV['PATHEXT'].split(';') exts = ENV['PATHEXT'].split(';')
end end
ENV['PATH'].encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').split(File::PATH_SEPARATOR).each do |path| current_verbose = $VERBOSE
exts.each do |ext| $VERBOSE = nil
exe = "#{path}#{File::SEPARATOR}#{cmd}#{ext}" begin
return exe if File.executable? exe 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 end
ensure
$VERBOSE = current_verbose
end end
return nil return nil