dart_bump 1.0.6
dart_bump: ^1.0.6 copied to clipboard
Dart automation tool for safe, consistent version bumps with CHANGELOG generation and Git/OpenAI integration.
example/dart_bump_example.dart
import 'dart:io';
import 'package:dart_bump/dart_bump.dart';
/// Usage:
/// dart dart_bump_example.dart [projectDir] [openaiApiKey]
///
/// - projectDir: path to the Dart project (defaults to current directory)
/// - openaiApiKey: OpenAI API key (optional; falls back to OPENAI_API_KEY env)
Future<void> main(List<String> args) async {
final projectDir = Directory(
args.isNotEmpty ? args[0] : Directory.current.path,
);
final apiKey = args.length > 1
? args[1]
: Platform.environment['OPENAI_API_KEY'];
final bump = DartBump(
projectDir,
changeLogGenerator: OpenAIChangeLogGenerator(apiKey: apiKey),
);
try {
final result = await bump.bump();
if (result == null) {
print('β Nothing to bump.');
return;
}
if (result.changeLogEntry != null) {
print('π Bump successful!');
}
} catch (e) {
print('β Error: $e');
exit(1);
}
}