Skip to content

Commit

Permalink
Merge pull request #1161 from CyBot/master
Browse files Browse the repository at this point in the history
Don't perform any changes when trying to use current node version
  • Loading branch information
coreybutler authored Sep 10, 2024
2 parents e11ee22 + 95133cb commit 718fd4a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,13 @@ func use(version string, cpuarch string, reload ...bool) {
}
}

// Check if a change is needed
curVersion, curCpuarch := node.GetCurrentVersion()
if version == curVersion && cpuarch == curCpuarch {
fmt.Println("node v" + version + " (" + cpuarch + "-bit) is already in use.")
return
}

// Make sure the version is installed. If not, warn.
if !node.IsVersionInstalled(env.root, version, cpuarch) {
fmt.Println("node v" + version + " (" + cpuarch + "-bit) is not installed.")
Expand Down

0 comments on commit 718fd4a

Please # to comment.