Return void from project migrate() (#112897)

This commit is contained in:
Jenn Magder
2022-10-05 13:22:56 -07:00
committed by GitHub
parent 69fc4fb622
commit b82cf76ff6
21 changed files with 73 additions and 134 deletions

View File

@@ -40,9 +40,7 @@ Future<void> buildWeb(
];
final ProjectMigration migration = ProjectMigration(migrators);
if (!migration.run()) {
throwToolExit('Failed to run all web migrations.');
}
migration.run();
final Status status = globals.logger.startProgress('Compiling $target for the Web...');
final Stopwatch sw = Stopwatch()..start();

View File

@@ -18,17 +18,16 @@ class ScrubGeneratedPluginRegistrant extends ProjectMigrator {
final Logger _logger;
@override
bool migrate() {
void migrate() {
final File registrant = _project.libDirectory.childFile('generated_plugin_registrant.dart');
final File gitignore = _project.parent.directory.childFile('.gitignore');
if (!removeFile(registrant)) {
return false;
return;
}
if (gitignore.existsSync()) {
processFileLines(gitignore);
}
return true;
}
// Cleans up the .gitignore by removing the line that mentions generated_plugin_registrant.