mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Fix incorrect creation of directory while downloading.
This commit is contained in:
+1
-1
@@ -92,7 +92,7 @@ func (downloader *downloaderImpl) handleTask(task *downloadTask) {
|
||||
return
|
||||
}
|
||||
|
||||
err = os.MkdirAll(filepath.Base(task.destination), 0755)
|
||||
err = os.MkdirAll(filepath.Dir(task.destination), 0755)
|
||||
if err != nil {
|
||||
task.result <- err
|
||||
return
|
||||
|
||||
@@ -73,8 +73,8 @@ func (s *DownloaderSuite) TestDownloadFileError(c *C) {
|
||||
d := NewDownloader(2)
|
||||
defer d.Shutdown()
|
||||
|
||||
res := <-d.Download("http://smira.ru/", "/no/such/file")
|
||||
c.Assert(res, ErrorMatches, ".*no such file or directory")
|
||||
res := <-d.Download("http://smira.ru/", "/")
|
||||
c.Assert(res, ErrorMatches, ".*permission denied")
|
||||
}
|
||||
|
||||
func (s *DownloaderSuite) TestDownloadTemp(c *C) {
|
||||
|
||||
Reference in New Issue
Block a user