Adding Cygwin detection, and fixing pathing issue in VirtualBox driver under Cygwin

This commit is contained in:
John Barney 2013-02-09 19:36:56 -08:00
parent 050cb482f3
commit 73eb86bad0
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,10 @@ module Vagrant
platform.include?("darwin9")
end
def cygwin?
platform.include?("cygwin")
end
[:darwin, :bsd, :freebsd, :linux, :solaris].each do |type|
define_method("#{type}?") do
platform.include?(type.to_s)

View File

@ -12,7 +12,10 @@ module VagrantPlugins
# Import the virtual machine
ovf_file = env[:machine].box.directory.join("box.ovf").to_s
env[:machine].id = env[:machine].provider.driver.import(ovf_file) do |progress|
if Vagrant::Util::Platform.cygwin?
ovf_file = `cygpath -w #{ovf_file}`.chomp
end
env[:machine].id = env[:machine].provider.driver.import(ovf_file) do |progress|
env[:ui].clear_line
env[:ui].report_progress(progress, 100, false)
end