bug fix for file-provisioner download file, including unit-test code.
pull/3899/head
开恒 10 years ago
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 !strings.HasSuffix(p.config.Destination, "/") {
if strings.HasSuffix(p.config.Destination, "/") {
return comm.DownloadDir(src, p.config.Destination, nil)
}

@ -192,5 +192,9 @@ func TestProvisionDownloadMkdirAll(t *testing.T) {
if _, err := os.Stat(path); err != nil {
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…
Cancel
Save