Skip to content

Commit 1681b40

Browse files
Merge pull request #24 from FlutterFlow/wenkai/better_logging
Add more logging
2 parents 70a8643 + 9d8b188 commit 1681b40

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.23
2+
3+
- Add more logging.
4+
15
## 0.0.22
26

37
- Add `--project-environment` option.

lib/src/flutterflow_api_client.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Future<String?> exportCode({
7676
String? commitHash,
7777
bool exportAsDebug = false,
7878
}) async {
79+
stderr.write('Downloading code with the FlutterFlow CLI...\n');
80+
stderr.write('You are exporting project $projectId.\n');
81+
stderr.write(
82+
'${branchName != null ? 'Branch: $branchName ' : ''}${environmentName != null ? 'Environment: $environmentName ' : ''}${commitHash != null ? 'Commit: $commitHash' : ''}\n');
7983
if (exportAsDebug && exportAsModule) {
8084
throw 'Cannot export as module and debug at the same time.';
8185
}
@@ -106,7 +110,8 @@ Future<String?> exportCode({
106110
extractArchiveToCurrentDirectory(projectFolder, destinationPath);
107111
}
108112

109-
folderName = projectFolder.first.name;
113+
var fileName = projectFolder.first.name;
114+
folderName = fileName.substring(0, fileName.indexOf(Platform.pathSeparator));
110115

111116
final postCodeGenerationFutures = <Future>[
112117
if (fix)
@@ -130,6 +135,7 @@ Future<String?> exportCode({
130135
} finally {
131136
client.close();
132137
}
138+
stderr.write('All done!\n');
133139
return folderName;
134140
}
135141

@@ -261,6 +267,7 @@ Future _downloadAssets({
261267
stderr.write('Error downloading asset $path. This is probably fine.\n');
262268
}
263269
});
270+
stderr.write('Downloading assets...\n');
264271
await Future.wait(futures);
265272
}
266273

@@ -279,7 +286,7 @@ Future _runFix({
279286
final workingDirectory = unzipToParentFolder
280287
? path_util.join(destinationPath, directory)
281288
: destinationPath;
282-
289+
stderr.write('Running flutter pub get...\n');
283290
final pubGetResult = await Process.run(
284291
'flutter',
285292
['pub', 'get'],
@@ -293,6 +300,7 @@ Future _runFix({
293300
'"flutter pub get" failed with code ${pubGetResult.exitCode}, stderr:\n${pubGetResult.stderr}\n');
294301
return;
295302
}
303+
stderr.write('Running dart fix...\n');
296304
final fixDirectory = unzipToParentFolder ? directory : '';
297305
final dartFixResult = await Process.run(
298306
'dart',
@@ -364,7 +372,7 @@ Future firebaseDeploy({
364372
);
365373
}
366374

367-
stdout.write('Initializing firebase...\n');
375+
stderr.write('Initializing firebase...\n');
368376
await Process.run(
369377
'firebase',
370378
['use', firebaseProjectId],

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutterflow_cli
22
description: >-
33
Command-line client for FlutterFlow. Export code from FlutterFlow projects.
4-
version: 0.0.22
4+
version: 0.0.23
55
homepage: https://github.com/FlutterFlow/flutterflow-cli
66
issue_tracker: https://github.com/flutterflow/flutterflow-issues
77

0 commit comments

Comments
 (0)