diff --git a/internal/installation/storage/storage.go b/internal/installation/storage/storage.go index cfc1772617..dde30e6ca5 100644 --- a/internal/installation/storage/storage.go +++ b/internal/installation/storage/storage.go @@ -105,7 +105,13 @@ func CachePath() string { return path } - return filepath.Join(BaseCachePath(), relativeCachePath()) + cachePath = filepath.Join(BaseCachePath(), relativeCachePath()) + if runtime.GOOS == "windows" { + // Explicitly append "cache" dir as the cachedir on Windows. + // It is the same as the local appdata dir (conflicts with config) + cachePath = filepath.Join(cachePath, "cache") + } + return cachePath } func GlobalBinDir() string { diff --git a/internal/installation/storage/storage_windows.go b/internal/installation/storage/storage_windows.go index 4a4986440a..861b69075d 100644 --- a/internal/installation/storage/storage_windows.go +++ b/internal/installation/storage/storage_windows.go @@ -18,5 +18,5 @@ func BaseCachePath() string { return cache } - return filepath.Join(homeDir, "AppData", "Local", "cache") + return filepath.Join(homeDir, "AppData", "Local") } diff --git a/test/integration/use_int_test.go b/test/integration/use_int_test.go index 1f133600a4..8197507073 100644 --- a/test/integration/use_int_test.go +++ b/test/integration/use_int_test.go @@ -126,10 +126,10 @@ func (suite *UseIntegrationTestSuite) TestReset() { cfg, err := config.New() suite.NoError(err) + rcfile, err := subshell.New(cfg).RcFile() + suite.NoError(err) if runtime.GOOS != "windows" { - rcfile, err := subshell.New(cfg).RcFile() fileutils.FileExists(rcfile) - suite.NoError(err) suite.Contains(string(fileutils.ReadFileUnsafe(rcfile)), ts.Dirs.DefaultBin, "PATH does not have your project in it") }