mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Create an empty zip file in ZipToolBuilder if the entry list is empty (#5311)
This can happen if you build an FLX in release mode for an app with no assets (such as the hello_world example)
This commit is contained in:
parent
6b3766d661
commit
8d5c2540ea
@ -50,6 +50,13 @@ class _ZipToolBuilder extends ZipBuilder {
|
||||
|
||||
@override
|
||||
void createZip(File outFile, Directory zipBuildDir) {
|
||||
// If there are no assets, then create an empty zip file.
|
||||
if (entries.isEmpty) {
|
||||
List<int> zipData = new ZipEncoder().encode(new Archive());
|
||||
outFile.writeAsBytesSync(zipData);
|
||||
return;
|
||||
}
|
||||
|
||||
if (outFile.existsSync())
|
||||
outFile.deleteSync();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user