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}"