mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-08 22:30:41 +00:00
Make FakeDownloader create dirs as Downloader does.
This commit is contained in:
@@ -3,6 +3,7 @@ package utils
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
type expectedRequest struct {
|
||||
@@ -61,6 +62,12 @@ func (f *FakeDownloader) Download(url string, filename string, result chan<- err
|
||||
return
|
||||
}
|
||||
|
||||
err := os.MkdirAll(filepath.Dir(filename), 0755)
|
||||
if err != nil {
|
||||
result <- err
|
||||
return
|
||||
}
|
||||
|
||||
outfile, err := os.Create(filename)
|
||||
if err != nil {
|
||||
result <- err
|
||||
|
||||
Reference in New Issue
Block a user