Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update error message when missing version argument. Fixes #722. #731

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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