From 8f480c86f0d8fa36b51baf5346edd828e09f772b Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 6 Jan 2026 13:28:33 -0500 Subject: [PATCH] Merge pull request #3801 from ActiveState/mitchell/cp-1289 Fixed cache dir path on Windows. --- internal/installation/storage/storage.go | 8 +++++++- internal/installation/storage/storage_windows.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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") }