Commit a380391b authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

common: allow files that don't exist to be URLs [GH-683]

parent 2dad0cdc
......@@ -11,6 +11,7 @@ BUG FIXES:
* core: Don't change background color on CLI anymore, making things look
a tad nicer in some terminals.
* core: multiple ISO URLs works properly in all builders. [GH-683]
* builder/amazon/chroot: Block when obtaining file lock to allow
parallel builds. [GH-689]
* builder/vmware: Cleanup of VMX keys works properly so cd-rom won't
......
......@@ -105,10 +105,9 @@ func DownloadableURL(original string) (string, error) {
url.Path = strings.Replace(url.Path, `\`, `/`, -1)
}
if _, err := os.Stat(url.Path); err != nil {
return "", err
}
// Only do the filepath transformations if the file appears
// to actually exist.
if _, err := os.Stat(url.Path); err == nil {
url.Path, err = filepath.Abs(url.Path)
if err != nil {
return "", err
......@@ -121,6 +120,7 @@ func DownloadableURL(original string) (string, error) {
url.Path = filepath.Clean(url.Path)
}
}
// Make sure it is lowercased
url.Scheme = strings.ToLower(url.Scheme)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment