Fixes [GH-654] on Windows 8x64 and Ruby 1.9.3p374

Replaces the command with absolute path version if it exists.
This commit is contained in:
Gabor Nagy 2013-06-01 14:29:45 +02:00
parent ccfd321ef9
commit 0936267314
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,11 @@ module Vagrant
def initialize(*command)
@options = command.last.is_a?(Hash) ? command.pop : {}
@command = command
if Platform.windows?
locations = `where #{command[0]}`
new_command = "#{locations.split("\n")[0]}"
@command[0] = new_command if $?.success? and File.exists?(new_command)
end
@logger = Log4r::Logger.new("vagrant::util::subprocess")
end