File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ class SystemCache {
34
34
if (Platform .environment.containsKey ('PUB_CACHE' )) {
35
35
return Platform .environment['PUB_CACHE' ];
36
36
} else if (Platform .isWindows) {
37
- // If a cache dir already exists in %APPDATA%, use it, else default to %LOCALAPPDATA%
37
+ // %LOCALAPPDATA% is preferred as the cache location over %APPDATA%, because the latter is synchronised between
38
+ // devices when the user roams between them, whereas the former is not.
39
+ // The default cache dir used to be in %APPDATA%, so to avoid breaking old installs,
40
+ // we use the old dir in %APPDATA% if it exists. Else, we use the new default location
41
+ // in %LOCALAPPDATA%.
38
42
var appData = Platform .environment['APPDATA' ];
39
43
var appDataCacheDir = p.join (appData, 'Pub' , 'Cache' );
40
44
if (io.dirExists (appDataCacheDir)) {
You can’t perform that action at this time.
0 commit comments