Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 59 lines 2.6 kB view raw
1diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart 2index a6c59bae07..21f6c9812a 100644 3--- a/packages/flutter_tools/lib/src/asset.dart 4+++ b/packages/flutter_tools/lib/src/asset.dart 5@@ -5,6 +5,7 @@ 6 import 'package:meta/meta.dart'; 7 import 'package:package_config/package_config.dart'; 8 9+import 'base/common.dart'; 10 import 'base/context.dart'; 11 import 'base/file_system.dart'; 12 import 'base/logger.dart'; 13@@ -14,6 +15,7 @@ import 'cache.dart'; 14 import 'convert.dart'; 15 import 'dart/package_map.dart'; 16 import 'devfs.dart'; 17+import 'globals.dart' as globals; 18 import 'flutter_manifest.dart'; 19 import 'license_collector.dart'; 20 import 'project.dart'; 21@@ -377,7 +379,7 @@ class ManifestAssetBundle implements AssetBundle { 22 for (final Map<String, Object> font in family['fonts'] as List<Map<String, Object>>) { 23 final Uri entryUri = _fileSystem.path.toUri(font['asset'] as String); 24 result.add(_Asset( 25- baseDir: _fileSystem.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'), 26+ baseDir: _fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), 27 relativeUri: Uri(path: entryUri.pathSegments.last), 28 entryUri: entryUri, 29 package: null, 30diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart 31index 11e3bf3e11..39d6fae0d1 100644 32--- a/packages/flutter_tools/lib/src/cache.dart 33+++ b/packages/flutter_tools/lib/src/cache.dart 34@@ -321,8 +321,15 @@ class Cache { 35 return; 36 } 37 assert(_lock == null); 38+ 39+ final Directory dir = _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter')); 40+ if (!dir.existsSync()) { 41+ dir.createSync(recursive: true); 42+ globals.os.chmod(dir, '755'); 43+ } 44+ 45 final File lockFile = 46- _fileSystem.file(_fileSystem.path.join(flutterRoot, 'bin', 'cache', 'lockfile')); 47+ _fileSystem.file(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'lockfile')); 48 try { 49 _lock = lockFile.openSync(mode: FileMode.write); 50 } on FileSystemException catch (e) { 51@@ -424,7 +431,7 @@ class Cache { 52 if (_rootOverride != null) { 53 return _fileSystem.directory(_fileSystem.path.join(_rootOverride.path, 'bin', 'cache')); 54 } else { 55- return _fileSystem.directory(_fileSystem.path.join(flutterRoot, 'bin', 'cache')); 56+ return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter')); 57 } 58 } 59