mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 07:03:17 +08:00
Fixes #41 - Issue with blank spaces in path
Forgot some uses of exec.Command() outside of the "use" command.
This commit is contained in:
13
src/nvm.go
13
src/nvm.go
@@ -340,8 +340,9 @@ func uninstall(version string) {
|
||||
fmt.Printf("Uninstalling node v"+version+"...")
|
||||
v, _ := node.GetCurrentVersion()
|
||||
if v == version {
|
||||
cmd := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "rmdir", env.symlink)
|
||||
cmd.Run()
|
||||
runElevated(fmt.Sprintf(`"%s" cmd /C rmdir "%s"`,
|
||||
filepath.Join(env.root, "elevate.cmd"),
|
||||
filepath.Clean(env.symlink)))
|
||||
}
|
||||
e := os.RemoveAll(filepath.Join(env.root, "v"+version))
|
||||
if e != nil {
|
||||
@@ -544,8 +545,12 @@ func enable() {
|
||||
}
|
||||
|
||||
func disable() {
|
||||
cmd := exec.Command(filepath.Join(env.root, "elevate.cmd"), "cmd", "/C", "rmdir", env.symlink)
|
||||
cmd.Run()
|
||||
if !runElevated(fmt.Sprintf(`"%s" cmd /C rmdir "%s"`,
|
||||
filepath.Join(env.root, "elevate.cmd"),
|
||||
filepath.Clean(env.symlink))) {
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println("nvm disabled")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user