mirror of
https://github.com/restic/restic.git
synced 2025-11-14 14:52:53 +00:00
Simplify cache directory creation
This commit is contained in:
3
internal/cache/cache.go
vendored
3
internal/cache/cache.go
vendored
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user