mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
Metadata file not being found should throw an error
This commit is contained in:
parent
16ad80fdeb
commit
6ab7f9f00a
@ -10,7 +10,6 @@ import (
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
@ -33,6 +32,9 @@ func Fetch(logger io.Writer, cdnUrl string, dir string, fs billy.Filesystem, sto
|
||||
metadataPath = filepath.Join(dir, f.Name())
|
||||
}
|
||||
}
|
||||
if metadataPath == "" {
|
||||
return errors.New("no metadata file found")
|
||||
}
|
||||
|
||||
metadataFile, err := fs.Open(metadataPath)
|
||||
if err != nil {
|
||||
@ -99,9 +101,9 @@ func Fetch(logger io.Writer, cdnUrl string, dir string, fs billy.Filesystem, sto
|
||||
return fmt.Errorf("checksum in metadata does not match dist-git file")
|
||||
}
|
||||
|
||||
err = os.MkdirAll(filepath.Join(dir, filepath.Dir(path)), 0755)
|
||||
err = fs.MkdirAll(filepath.Join(dir, filepath.Dir(path)), 0755)
|
||||
if err != nil {
|
||||
return fmt.Errorf("could create all directories")
|
||||
return fmt.Errorf("could not create all directories")
|
||||
}
|
||||
|
||||
f, err := fs.Create(filepath.Join(dir, path))
|
||||
|
Loading…
Reference in New Issue
Block a user