Skip to content

Commit

Permalink
Updated error output for bad version aliases and atttempt to resolve …
Browse files Browse the repository at this point in the history
…desired alias.
  • Loading branch information
coreybutler committed Feb 5, 2023
1 parent e7cb08e commit 6e2c8da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,13 @@ func install(version string, cpuarch string) {
env.verifyssl = false
}

if strings.HasPrefix(version, "--") {
fmt.Println("\"--\" prefixes are unnecessary in NVM for Windows!")
version = strings.ReplaceAll(version, "-", "")
fmt.Printf("attempting to install \"%v\" instead...\n\n", version)
time.Sleep(2 * time.Second)
}

v, a, err := getVersion(version, cpuarch)
version = v
cpuarch = a
Expand Down Expand Up @@ -513,6 +520,7 @@ func versionNumberFrom(version string) string {
}
}
fmt.Printf("\"%v\" is not a valid version or known alias.\n", version)
fmt.Println("\nAvailable aliases: latest, node (latest), lts\nNamed releases (boron, dubnium, etc) are also supported.")
os.Exit(0)
}
}
Expand Down

0 comments on commit 6e2c8da

Please sign in to comment.