Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/flutterfire_cli/lib/src/commands/update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,29 @@ class UpdateCommand extends FlutterFireCommand {
commandRequiresFlutterApp();

logger.stdout('Cleaning up current workspace ...');
final flutterCmd = Platform.isWindows ? 'flutter.bat' : 'flutter';
await Process.run(
'flutter',
flutterCmd,
['clean'],
);
await Process.run(
'rm',
['pubspec.lock'],
);
final pubspecLockFile = File('pubspec.lock');
if (pubspecLockFile.existsSync()) {
await pubspecLockFile.delete();
}

logger.stdout('Upgrading all firebase plugins to the latest version ...');
for (final package in flutterfirePackages) {
// We run each package individually because chaining them
// will fail at the first package not in the pubspec.
await Process.run(
'flutter',
flutterCmd,
['pub', 'upgrade', '--major-versions', package],
);
}

logger.stdout("Running 'flutter pub get'...");
await Process.run(
'flutter',
flutterCmd,
['pub', 'get'],
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ class FirebaseDartConfigurationWrite {
}
}

return formatList(fileConfigurationLines).join('\n');
return '${formatList(fileConfigurationLines).join('\n')}\n';
}

String _buildConfigurationFile() {
_stringBuffer.clear();
_writeHeader();
_writeClass();
return formatList(_stringBuffer.toString().split('\n')).join('\n');
return '${formatList(_stringBuffer.toString().split('\n')).join('\n')}\n';
}

// ensure only one empty line between each static property
Expand Down
Loading