getVersionFromArgsOrPubspec method

Future<String> getVersionFromArgsOrPubspec()

Implementation

Future<String> getVersionFromArgsOrPubspec() async {
  final args = ensureArgResults();
  try {
    return args.rest.isNotEmpty
        ? args.rest.first
        : await getVersionFromPubspec();

    // ignore: avoid_catching_errors
  } on NoPubspecFileFound {
    throw ArgumentError(
      'No pubspec.yaml found. Please provide a version to increment from.',
    );
  }
}