Commit 8d5c2540 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

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)
parent 6b3766d6
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment