From 7524e7a3c0396f12b69a4eaf812e31503b7b63f3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 22 Apr 2013 20:41:47 -0700 Subject: [PATCH] Box add URL with windows drive letter works properly --- CHANGELOG.md | 2 ++ lib/vagrant/action/builtin/box_add.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65fff61cc..6806692bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ BUG FIXES: fail to detect the box. [GH-1617] - In a multi-machine environment, a box not found won't be downloaded multiple times. [GH-1467] + - `vagrant box add` with a file path now works correctly on Windows + when a drive letter is specified. ## 1.2.1 (April 17, 2013) diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb index 020a90eac..f0813092f 100644 --- a/lib/vagrant/action/builtin/box_add.rb +++ b/lib/vagrant/action/builtin/box_add.rb @@ -19,8 +19,8 @@ module Vagrant @logger.info("Downloading box to: #{@temp_path}") url = env[:box_url] - if url !~ /^[a-z0-9]+:.*$/i - @logger.info("No protocol found on box URL, assuming file:") + if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i + @logger.info("URL is a file or protocol not found and assuming file.") file_path = File.expand_path(url) file_path = Util::Platform.cygwin_windows_path(file_path) url = "file:#{file_path}"