Skip to content

Commit

Permalink
Updated build tools. Now supports links to elevate.cmd and elevate.vb…
Browse files Browse the repository at this point in the history
…s when using nvm root (fixes coreybutler#381).
  • Loading branch information
coreybutler committed Aug 30, 2018
1 parent b87de53 commit 72754b3
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 5 deletions.
Binary file modified buildtools/ISCmplr.dll
Binary file not shown.
Binary file modified buildtools/ISPP.dll
Binary file not shown.
Binary file modified buildtools/Setup.e32
Binary file not shown.
Binary file modified buildtools/SetupLdr.e32
Binary file not shown.
Binary file modified buildtools/iscc.exe
Binary file not shown.
Binary file modified buildtools/islzma.dll
Binary file not shown.
Binary file modified buildtools/zip.exe
Binary file not shown.
18 changes: 13 additions & 5 deletions src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,17 @@ func install(version string, cpuarch string) {
fmt.Println("Node.js v"+version+" is not yet released or available.")
return
}

if cpuarch == "64" && !web.IsNode64bitAvailable(version) {
fmt.Println("Node.js v"+version+" is only available in 32-bit.")
return
}

// Check to see if the version is already installed
if !node.IsVersionInstalled(env.root,version,cpuarch) {

if !node.IsVersionAvailable(version){
fmt.Println("Version "+version+" is not available. If you are attempting to download a \"just released\" version,")
fmt.Println("it may not be recognized by the nvm service yet (updated hourly). If you feel this is in error and")
fmt.Println("you know the version exists, please visit http://github.com/coreybutler/nodedistro and submit a PR.")
url := web.GetFullNodeUrl("index.json")
fmt.Println("\nVersion "+version+" is not available.\n\nThe complete list of available versions can be found at " + url)
return
}

Expand Down Expand Up @@ -654,9 +653,18 @@ func updateRootDir(path string) {
return
}

currentRoot := env.root
env.root = filepath.Clean(path)

// Copy command files
os.Link(filepath.Clean(currentRoot + "/elevate.cmd"), filepath.Clean(env.root + "/elevate.cmd"))
os.Link(filepath.Clean(currentRoot + "/elevate.cmd"), filepath.Clean(env.root + "/elevate.vbs"))

saveSettings()
fmt.Println("\nRoot has been set to "+path)

if currentRoot != env.root {
fmt.Println("\nRoot has been changed from " + currentRoot + " to " + path)
}
}

func runElevated(command string) bool {
Expand Down

0 comments on commit 72754b3

Please sign in to comment.