Skip to content

Commit 5af4422

Browse files
committed
remove duplicate archiving
1 parent 68b3597 commit 5af4422

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/src/flutterflow_cli_base.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ Future<String?> exportCode({
6868
projectId: projectId,
6969
branchName: branchName,
7070
);
71-
7271
// Download actual code
7372
final projectZipBytes = base64Decode(result['project_zip']);
7473
final projectFolder = ZipDecoder().decodeBytes(projectZipBytes);
@@ -80,7 +79,6 @@ Future<String?> exportCode({
8079
}
8180

8281
folderName = projectFolder.first.name;
83-
extractArchiveToDisk(projectFolder, destinationPath);
8482

8583
final postCodeGenerationFutures = <Future>[
8684
if (fix)
@@ -94,6 +92,7 @@ Future<String?> exportCode({
9492
client: client,
9593
destinationPath: destinationPath,
9694
assetDescriptions: result['assets'],
95+
unzipToParentFolder: unzipToParentFolder,
9796
),
9897
];
9998

@@ -181,9 +180,16 @@ Future _downloadAssets({
181180
required final http.Client client,
182181
required String destinationPath,
183182
required List<dynamic> assetDescriptions,
183+
required unzipToParentFolder,
184184
}) async {
185185
final futures = assetDescriptions.map((assetDescription) async {
186-
final path = assetDescription['path'];
186+
String path = assetDescription['path'];
187+
188+
if (!unzipToParentFolder) {
189+
path = path_util.joinAll(
190+
path_util.split(path).sublist(1),
191+
);
192+
}
187193
final url = assetDescription['url'];
188194
final fileDest = path_util.join(destinationPath, path);
189195
try {

0 commit comments

Comments
 (0)