fix #3897
bug fix for file-provisioner download file, including unit-test code.
This commit is contained in:
parent
5919f8d552
commit
96a637684b
|
@ -109,7 +109,7 @@ func (p *Provisioner) ProvisionDownload(ui packer.Ui, comm packer.Communicator)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if the config.Destination was a dir, download the dir
|
// if the config.Destination was a dir, download the dir
|
||||||
if !strings.HasSuffix(p.config.Destination, "/") {
|
if strings.HasSuffix(p.config.Destination, "/") {
|
||||||
return comm.DownloadDir(src, p.config.Destination, nil)
|
return comm.DownloadDir(src, p.config.Destination, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,5 +192,9 @@ func TestProvisionDownloadMkdirAll(t *testing.T) {
|
||||||
if _, err := os.Stat(path); err != nil {
|
if _, err := os.Stat(path); err != nil {
|
||||||
t.Fatalf("stat of download dir should not error: %s", err)
|
t.Fatalf("stat of download dir should not error: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if _, err := os.Stat(config["destination"].(string)); err != nil {
|
||||||
|
t.Fatalf("stat of destination file should not error: %s", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue