mirror of
https://github.com/restic/restic.git
synced 2024-12-23 16:26:11 +00:00
cache: Correctly return dir for Windows/darwin
This commit is contained in:
parent
fe1f151ae1
commit
ea593fca1b
1 changed files with 8 additions and 2 deletions
10
internal/cache/dir.go
vendored
10
internal/cache/dir.go
vendored
|
@ -56,10 +56,16 @@ func DefaultDir() (cachedir string, err error) {
|
||||||
cachedir, err = darwinCacheDir()
|
cachedir, err = darwinCacheDir()
|
||||||
case "windows":
|
case "windows":
|
||||||
cachedir, err = windowsCacheDir()
|
cachedir, err = windowsCacheDir()
|
||||||
|
default:
|
||||||
|
// Default to XDG for Linux and any other OSes.
|
||||||
|
cachedir, err = xdgCacheDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to XDG for Linux and any other OSes.
|
if err != nil {
|
||||||
return xdgCacheDir()
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return cachedir, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func mkdirCacheDir(cachedir string) error {
|
func mkdirCacheDir(cachedir string) error {
|
||||||
|
|
Loading…
Reference in a new issue