comments (#47473)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
b011ea5468
commit
41a911099b
@@ -34,6 +34,11 @@ Future<Depfile> copyAssets(Environment environment, Directory outputDirectory) a
|
||||
assetBundle.entries.entries.map<Future<void>>((MapEntry<String, DevFSContent> entry) async {
|
||||
final PoolResource resource = await pool.request();
|
||||
try {
|
||||
// This will result in strange looking files, for example files with `/`
|
||||
// on Windows or files that end up getting URI encoded such as `#.ext`
|
||||
// to `%23.ext`. However, we have to keep it this way since the
|
||||
// platform channels in the framework will URI encode these values,
|
||||
// and the native APIs will look for files this way.
|
||||
final File file = fs.file(fs.path.join(outputDirectory.path, entry.key));
|
||||
outputs.add(file);
|
||||
file.parent.createSync(recursive: true);
|
||||
|
||||
@@ -195,6 +195,11 @@ Future<void> writeBundle(
|
||||
assetEntries.entries.map<Future<void>>((MapEntry<String, DevFSContent> entry) async {
|
||||
final PoolResource resource = await pool.request();
|
||||
try {
|
||||
// This will result in strange looking files, for example files with `/`
|
||||
// on Windows or files that end up getting URI encoded such as `#.ext`
|
||||
// to `%23.ext`. However, we have to keep it this way since the
|
||||
// platform channels in the framework will URI encode these values,
|
||||
// and the native APIs will look for files this way.
|
||||
final File file = fs.file(fs.path.join(bundleDir.path, entry.key));
|
||||
file.parent.createSync(recursive: true);
|
||||
await file.writeAsBytes(await entry.value.contentsAsBytes());
|
||||
|
||||
Reference in New Issue
Block a user