diff --git a/packages/aft/lib/src/commands/version_bump_command.dart b/packages/aft/lib/src/commands/version_bump_command.dart index 15ed74d842..e02da0aa4f 100644 --- a/packages/aft/lib/src/commands/version_bump_command.dart +++ b/packages/aft/lib/src/commands/version_bump_command.dart @@ -90,19 +90,20 @@ class VersionBumpCommand extends AmplifyCommand final bumpedPackages = []; for (final package in repo.publishablePackages()) { final edits = package.pubspecInfo.pubspecYamlEditor.edits; - if (edits.isNotEmpty) { - bumpedPackages.add(package); - if (preview) { - logger.info('pubspec.yaml'); - for (final edit in edits) { - final originalText = package.pubspecInfo.pubspecYaml - .substring(edit.offset, edit.offset + edit.length); - logger.info('$originalText --> ${edit.replacement}'); - } - } else { - await File(p.join(package.path, 'pubspec.yaml')) - .writeAsString(package.pubspecInfo.pubspecYamlEditor.toString()); + if (edits.isEmpty) { + continue; + } + bumpedPackages.add(package); + if (preview) { + logger.info('pubspec.yaml'); + for (final edit in edits) { + final originalText = package.pubspecInfo.pubspecYaml + .substring(edit.offset, edit.offset + edit.length); + logger.info('$originalText --> ${edit.replacement}'); } + } else { + await File(p.join(package.path, 'pubspec.yaml')) + .writeAsString(package.pubspecInfo.pubspecYamlEditor.toString()); } final changelogUpdate = changelogUpdates[package]; if (changelogUpdate != null && changelogUpdate.hasUpdate) {