Simplify cache directory creation

This commit is contained in:
greatroar
2020-10-05 10:22:05 +02:00
parent 3c6671b18b
commit 7d0fa1a686
2 changed files with 2 additions and 34 deletions

View File

@@ -96,7 +96,7 @@ func New(id string, basedir string) (c *Cache, err error) {
}
}
created, err := mkdirCacheDir(basedir)
err = fs.MkdirAll(basedir, 0700)
if err != nil {
return nil, err
}
@@ -119,6 +119,7 @@ func New(id string, basedir string) (c *Cache, err error) {
}
// create the repo cache dir if it does not exist yet
var created bool
_, err = fs.Lstat(cachedir)
if os.IsNotExist(err) {
err = fs.MkdirAll(cachedir, dirMode)