Commit 7cdf113e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/common: set the proper finalPath if downloading

parent bfcd264e
...@@ -86,6 +86,8 @@ func (d *DownloadClient) Get() (string, error) { ...@@ -86,6 +86,8 @@ func (d *DownloadClient) Get() (string, error) {
if url.Scheme == "file" && !d.config.CopyFile { if url.Scheme == "file" && !d.config.CopyFile {
finalPath = url.Path finalPath = url.Path
} else { } else {
finalPath = d.config.TargetPath
var ok bool var ok bool
d.downloader, ok = d.config.DownloaderMap[url.Scheme] d.downloader, ok = d.config.DownloaderMap[url.Scheme]
if !ok { if !ok {
...@@ -93,7 +95,7 @@ func (d *DownloadClient) Get() (string, error) { ...@@ -93,7 +95,7 @@ func (d *DownloadClient) Get() (string, error) {
} }
// Otherwise, download using the downloader. // Otherwise, download using the downloader.
f, err := os.Create(d.config.TargetPath) f, err := os.Create(finalPath)
if err != nil { if err != nil {
return "", err return "", err
} }
......
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