From d9d549ceb3aa20c8c4fc597a722c44bf1da24f55 Mon Sep 17 00:00:00 2001 From: bponders12-cell Date: Mon, 31 Aug 2026 22:03:32 -0400 Subject: [PATCH] fix: use stderr/stdout instead of print in version tool --- tool/bump_version.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tool/bump_version.dart b/tool/bump_version.dart index 9e11895..acbe3f2 100644 --- a/tool/bump_version.dart +++ b/tool/bump_version.dart @@ -1,15 +1,15 @@ -import 'dart:io'; +import 'dart:io'; void main(List args) { if (args.isEmpty) { - print('Usage: dart run tool/bump_version.dart '); + stderr.writeln('Usage: dart run tool/bump_version.dart '); exit(1); } final action = args[0].toLowerCase(); final pubspecFile = File('pubspec.yaml'); if (!pubspecFile.existsSync()) { - print('Error: pubspec.yaml not found.'); + stderr.writeln('Error: pubspec.yaml not found.'); exit(1); } @@ -18,7 +18,7 @@ void main(List args) { final match = versionRegex.firstMatch(pubspecContent); if (match == null) { - print('Error: could not find version pattern in pubspec.yaml'); + stderr.writeln('Error: could not find version pattern in pubspec.yaml'); exit(1); } @@ -47,12 +47,12 @@ void main(List args) { build++; break; default: - print('Unknown action "$action". Use patch, minor, major, or build.'); + stderr.writeln('Unknown action "$action". Use patch, minor, major, or build.'); exit(1); } final newVersion = '$major.$minor.$patch+$build'; - print('Bumping version to: $newVersion'); + stdout.writeln('Bumping version to: $newVersion'); final updatedPubspec = pubspecContent.replaceFirst(versionRegex, 'version: $newVersion'); pubspecFile.writeAsStringSync(updatedPubspec); @@ -65,5 +65,5 @@ void main(List args) { appInfoFile.writeAsStringSync(updatedAppInfo); } - print('Successfully updated pubspec.yaml and lib/core/app_info.dart to $newVersion'); + stdout.writeln('Successfully updated pubspec.yaml and lib/core/app_info.dart to $newVersion'); }