builder/common: set the proper finalPath if downloading

This commit is contained in:
Mitchell Hashimoto 2013-06-23 15:58:47 -07:00
parent bfcd264e67
commit 7cdf113eb1
1 changed files with 3 additions and 1 deletions

View File

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