From fa77d6810f81a13dc6d1ab1aa35cc64376e053b5 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 24 Jan 2014 13:10:27 -0800 Subject: [PATCH] core: BoxAdd expands URL paths --- lib/vagrant/action/builtin/box_add.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb index 0db0ba31d..8a5b011f7 100644 --- a/lib/vagrant/action/builtin/box_add.rb +++ b/lib/vagrant/action/builtin/box_add.rb @@ -22,7 +22,16 @@ module Vagrant def call(env) @download_interrupted = false - url = Array(env[:box_url]) + url = Array(env[:box_url]).map do |u| + next u if u =~ /^[a-z0-9]+:.*$/i + + # Expand the path and try to use that, if possible + p = File.expand_path(u) + p = Util::Platform.cygwin_windows_path(p) + next p if File.file?(p) + + u + end # If we received a shorthand URL ("mitchellh/precise64"), # then expand it properly.