Skip to content

Commit 7215bcf

Browse files
committed
Fixed cache dir path on Windows.
1 parent c7295d8 commit 7215bcf

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

internal/installation/storage/storage.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,13 @@ func CachePath() string {
105105
return path
106106
}
107107

108-
return filepath.Join(BaseCachePath(), relativeCachePath())
108+
cachePath = filepath.Join(BaseCachePath(), relativeCachePath())
109+
if runtime.GOOS == "windows" {
110+
// Explicitly append "cache" dir as the cachedir on Windows.
111+
// It is the same as the local appdata dir (conflicts with config)
112+
cachePath = filepath.Join(cachePath, "cache")
113+
}
114+
return cachePath
109115
}
110116

111117
func GlobalBinDir() string {

internal/installation/storage/storage_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ func BaseCachePath() string {
1818
return cache
1919
}
2020

21-
return filepath.Join(homeDir, "AppData", "Local", "cache")
21+
return filepath.Join(homeDir, "AppData", "Local")
2222
}

0 commit comments

Comments
 (0)