Convert Windows paths in volumes if detected
This commit is contained in:
parent
36ecd40c52
commit
27ca3ef831
|
@ -85,7 +85,19 @@ module VagrantPlugins
|
|||
image = params.fetch(:image)
|
||||
links = params.fetch(:links)
|
||||
ports = Array(params[:ports])
|
||||
volumes = Array(params[:volumes])
|
||||
volumes = Array(params[:volumes]).map do |v|
|
||||
v = v.to_s
|
||||
if v.include?(":") && (Vagrant::Util::Platform.windows? || Vagrant::Util::Platform.wsl?)
|
||||
host, guest = v.split(":", 2)
|
||||
host = Vagrant::Util::Platform.windows_path(host)
|
||||
# NOTE: Docker does not support UNC style paths (which also
|
||||
# means that there's no long path support). Hopefully this
|
||||
# will be fixed someday and the gsub below can be removed.
|
||||
host.gsub!(/^[^A-Za-z]+/, "")
|
||||
v = [host, guest].join(":")
|
||||
end
|
||||
v
|
||||
end
|
||||
cmd = Array(params.fetch(:cmd))
|
||||
env = Hash[*params.fetch(:env).flatten.map(&:to_s)]
|
||||
expose = Array(params[:expose])
|
||||
|
|
Loading…
Reference in New Issue