Skip to content

Commit f538704

Browse files
authored
Merge pull request #1210 from CyBot/master
Don't perform any changes when trying to use current node version
2 parents c059022 + 9bee6e7 commit f538704

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/nvm.go

+8
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,14 @@ func use(version string, cpuarch string, reload ...bool) {
11541154
}
11551155
}
11561156

1157+
// Check if a change is needed
1158+
curVersion, curCpuarch := node.GetCurrentVersion()
1159+
if version == curVersion && cpuarch == curCpuarch {
1160+
fmt.Println("node v" + version + " (" + cpuarch + "-bit) is already in use.")
1161+
status <- Status{Done: true}
1162+
return
1163+
}
1164+
11571165
// Make sure the version is installed. If not, warn.
11581166
if !node.IsVersionInstalled(env.root, version, cpuarch) {
11591167
err = fmt.Errorf("node v%s (%v-bit) is not installed.", version, cpuarch)

0 commit comments

Comments
 (0)