Skip to content

Commit

Permalink
Merge pull request #731 from 0liver/patch-1
Browse files Browse the repository at this point in the history
Update error message when missing version argument. Fixes #722.
  • Loading branch information
coreybutler committed Jan 17, 2022
2 parents 1f7a706 + 3cbd0f7 commit 7c7010a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func getVersion(version string, cpuarch string, localInstallsOnly ...bool) (stri
}

if version == "" {
return "", cpuarch, errors.New("Invalid version.")
return "", cpuarch, errors.New("A version argument is required but missing.")
}

// If user specifies "latest" version, find out what version is
Expand All @@ -212,7 +212,7 @@ func getVersion(version string, cpuarch string, localInstallsOnly ...bool) (stri
if version == "newest" {
installed := node.GetInstalled(env.root)
if len(installed) == 0 {
return version, "", errors.New("No versions of node.js found. Try installing the latest by typing nvm install latest")
return version, "", errors.New("No versions of node.js found. Try installing the latest by typing nvm install latest.")
}

version = installed[0]
Expand Down Expand Up @@ -449,7 +449,7 @@ func uninstall(version string) {
} else if strings.ToLower(version) == "newest" {
installed := node.GetInstalled(env.root)
if len(installed) == 0 {
fmt.Println("No versions of node.js found. Try installing the latest by typing nvm install latest")
fmt.Println("No versions of node.js found. Try installing the latest by typing nvm install latest.")
return
}

Expand Down Expand Up @@ -916,7 +916,7 @@ func useArchitecture(a string) {
if a == "32" || a == "64" {
env.arch = a
saveSettings()
fmt.Println("Set to "+a+"-bit mode")
fmt.Println("Set to "+a+"-bit mode.")
} else {
fmt.Println("Cannot set architecture to "+a+". Must be 32 or 64 are acceptable values.")
}
Expand Down

0 comments on commit 7c7010a

Please sign in to comment.