From 7411e8dc41d9205ec74f298521ef294f9c2e9728 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 23 Jun 2013 15:58:47 -0700 Subject: [PATCH] builder/common: set the proper finalPath if downloading --- builder/common/download.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builder/common/download.go b/builder/common/download.go index 400d61b98..fead9d4d9 100644 --- a/builder/common/download.go +++ b/builder/common/download.go @@ -86,6 +86,8 @@ func (d *DownloadClient) Get() (string, error) { if url.Scheme == "file" && !d.config.CopyFile { finalPath = url.Path } else { + finalPath = d.config.TargetPath + var ok bool d.downloader, ok = d.config.DownloaderMap[url.Scheme] if !ok { @@ -93,7 +95,7 @@ func (d *DownloadClient) Get() (string, error) { } // Otherwise, download using the downloader. - f, err := os.Create(d.config.TargetPath) + f, err := os.Create(finalPath) if err != nil { return "", err }