Skip to content

Commit

Permalink
Merge pull request #15 from ankitcharolia/fix/dont-install-active-ver…
Browse files Browse the repository at this point in the history
…sion

fix(bug): don't install already installed and active GOLANG version
  • Loading branch information
ankitcharolia committed Aug 29, 2023
2 parents e69ddea + b8b347a commit c39a8cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ func listRemoteVersions() {
}

func installGoVersion(version string) {
if isInstalled(version) {
activeVersion := getCurrentGoVersion()
if isInstalled(version) || version == activeVersion {
greenColor := "\033[32m"
resetColor := "\033[0m"
fmt.Printf("%sGo version %s is already installed.%s\n", greenColor, version, resetColor)
return
os.Exit(0)
}

// Install the specific Go version
Expand Down

0 comments on commit c39a8cd

Please sign in to comment.