fix(download): consider if a template specifies a sub directory (#498)

This commit is contained in:
Matt Robinson 2024-02-13 23:36:04 -05:00 committed by GitHub
parent 150d93e783
commit 56e4812e5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,7 +95,7 @@ func (p *progress) donePost(elem *iterElem) error {
}
}
if err := os.Rename(elem.to.Name(), filepath.Join(p.opts.Dir, newfile)); err != nil {
if err := os.Rename(elem.to.Name(), filepath.Join(filepath.Dir(elem.to.Name()), newfile)); err != nil {
return errors.Wrap(err, "rename file")
}