From 361893b180d52cf5c6c8e27125db04cc3cd5c596 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 3 Mar 2016 15:18:32 -0800 Subject: [PATCH] fix the zip tool when building for ios --- packages/flutter_tools/lib/src/zip.dart | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/packages/flutter_tools/lib/src/zip.dart b/packages/flutter_tools/lib/src/zip.dart index 1eb874bfe4..fb6c28ef18 100644 --- a/packages/flutter_tools/lib/src/zip.dart +++ b/packages/flutter_tools/lib/src/zip.dart @@ -91,16 +91,21 @@ class _ZipToolBuilder extends ZipBuilder { } } - runCheckedSync( - ['zip', '-q', outFile.absolute.path]..addAll(_getCompressedNames()), - workingDirectory: zipBuildDir.path, - truncateCommand: true - ); - runCheckedSync( - ['zip', '-q', '-0', outFile.absolute.path]..addAll(_getStoredNames()), - workingDirectory: zipBuildDir.path, - truncateCommand: true - ); + if (_getCompressedNames().isNotEmpty) { + runCheckedSync( + ['zip', '-q', outFile.absolute.path]..addAll(_getCompressedNames()), + workingDirectory: zipBuildDir.path, + truncateCommand: true + ); + } + + if (_getStoredNames().isNotEmpty) { + runCheckedSync( + ['zip', '-q', '-0', outFile.absolute.path]..addAll(_getStoredNames()), + workingDirectory: zipBuildDir.path, + truncateCommand: true + ); + } } Iterable _getCompressedNames() {