Skip to content

Commit

Permalink
Merge pull request #1210 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 Jan 2, 2025
2 parents c059022 + 9bee6e7 commit f538704
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 @@ -1154,6 +1154,14 @@ 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.")
status <- Status{Done: true}
return
}

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

0 comments on commit f538704

Please sign in to comment.