checkForUpdate function

Future<VersionCheckResult?> checkForUpdate(
  1. String currentVersion
)

Checks for available updates of commands_cli

Implementation

Future<VersionCheckResult?> checkForUpdate(String currentVersion) async {
  final installationInfo = await detectInstallationSource();

  if (installationInfo.source == InstallationSource.git) {
    return await _checkGitHubRelease(currentVersion, installationInfo.gitUrl);
  } else {
    return await _checkPubDev(currentVersion);
  }
}