Ensure VirtualBox virtual disks are stored in the correct directory on Windows hosts

This commit is contained in:
Keith Shook 2014-07-01 09:00:23 -04:00
parent bf2e8deebe
commit 0912ddaf5f
2 changed files with 10 additions and 2 deletions

View File

@ -185,7 +185,11 @@ module VagrantPlugins
disk_params << "--unit"
disk_params << unit_num
disk_params << "--disk"
disk_params << path.reverse.sub("/#{suggested_name}/".reverse, "/#{specified_name}/".reverse).reverse # Replace only last occurence
if Gem.win_platform?
disk_params << path.reverse.sub("\\#{suggested_name}\\".reverse, "\\#{specified_name}\\".reverse).reverse # Replace only last occurence
else
disk_params << path.reverse.sub("/#{suggested_name}/".reverse, "/#{specified_name}/".reverse).reverse # Replace only last occurence
end
end
execute("import", ovf , *name_params, *disk_params) do |type, data|

View File

@ -193,7 +193,11 @@ module VagrantPlugins
disk_params << "--unit"
disk_params << unit_num
disk_params << "--disk"
disk_params << path.reverse.sub("/#{suggested_name}/".reverse, "/#{specified_name}/".reverse).reverse # Replace only last occurence
if Gem.win_platform?
disk_params << path.reverse.sub("\\#{suggested_name}\\".reverse, "\\#{specified_name}\\".reverse).reverse # Replace only last occurence
else
disk_params << path.reverse.sub("/#{suggested_name}/".reverse, "/#{specified_name}/".reverse).reverse # Replace only last occurence
end
end
execute("import", ovf , *name_params, *disk_params) do |type, data|