From 42c70eab1bb5a1a0b0d63911191fb0e099eae08b Mon Sep 17 00:00:00 2001 From: Curtis Schlak <156-curtis@users.noreply.gitlab.galvanize.com> Date: Wed, 6 Mar 2024 08:32:27 -0600 Subject: [PATCH] Make version error messages mutually exclusive. --- app/cmd/root.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/cmd/root.go b/app/cmd/root.go index 8d1cee4..a1587b4 100644 --- a/app/cmd/root.go +++ b/app/cmd/root.go @@ -158,11 +158,9 @@ func setupLearnAPI(getPresignedPostUrl bool) { versionInstalled, versionInstalledErr := semver.NewVersion(currentReleaseVersion) if versionRemoteErr != nil { fmt.Printf("Failed to parse the CLI's current version. Err: %v", err) - } - if versionInstalledErr != nil { + } else if versionInstalledErr != nil { fmt.Printf("Failed to parse the latest CLI release version. Err: %v", err) - } - if versionInstalled.LessThan(versionRemote) { + } else if versionInstalled.LessThan(versionRemote) { fmt.Printf("\nWARNING: There is newer version of the learn tool available.\nLatest: %s\nCurrent: %s\nTo avoid issues, upgrade by following the instructions at this link:\nhttps://github.com/gSchool/glearn-cli/blob/master/upgrade_instructions.md\n\n", version, currentReleaseVersion) } }