getCommandVersion method
Get the version of a command
Implementation
Future<String?> getCommandVersion(
String command, {
List<String> versionArgs = const <String>['--version'],
}) async {
try {
final ProcessResult result = await run(command, versionArgs);
if (result.success) {
return result.stdout.trim().split('\n').first;
}
return null;
} catch (e) {
return null;
}
}