mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-08 22:30:41 +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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.MkdirAll(filepath.Base(task.destination), 0755)
|
err = os.MkdirAll(filepath.Dir(task.destination), 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
task.result <- err
|
task.result <- err
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -73,8 +73,8 @@ func (s *DownloaderSuite) TestDownloadFileError(c *C) {
|
|||||||
d := NewDownloader(2)
|
d := NewDownloader(2)
|
||||||
defer d.Shutdown()
|
defer d.Shutdown()
|
||||||
|
|
||||||
res := <-d.Download("http://smira.ru/", "/no/such/file")
|
res := <-d.Download("http://smira.ru/", "/")
|
||||||
c.Assert(res, ErrorMatches, ".*no such file or directory")
|
c.Assert(res, ErrorMatches, ".*permission denied")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DownloaderSuite) TestDownloadTemp(c *C) {
|
func (s *DownloaderSuite) TestDownloadTemp(c *C) {
|
||||||
|
|||||||
Reference in New Issue
Block a user