Merge pull request #1161 from CyBot/master

Don't perform any changes when trying to use current node version
This commit is contained in:
Corey Butler
2024-09-10 09:32:49 -05:00
committed by GitHub

View File

@@ -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.")