getVersionCommand function

Future<String> getVersionCommand(
  1. ExecuteCommandFunction executeShellCommand
)

Implementation

Future<String> getVersionCommand(
    ExecuteCommandFunction executeShellCommand) async {
  final output = await executeShellCommand(ExecuteCommandInput(
    command: "heroku",
    args: ["--version"],
  ));

  final match = _versionRegex.firstMatch(output.stdout);
  if (match != null) {
    return match.group(1)!;
  } else {
    return "8.0.0";
  }
}