mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 07:03:17 +08:00
Updated elevation approach
This commit is contained in:
@@ -943,7 +943,12 @@ func updateRootDir(path string) {
|
||||
}
|
||||
|
||||
func elevatedRun(name string, arg ...string) (bool, error) {
|
||||
return run(filepath.Join(env.root, "elevate.cmd"), append([]string{"cmd", "/C", name}, arg...)...)
|
||||
ok, err := run("cmd", append([]string{"/C", name}, arg...)...)
|
||||
if err != nil {
|
||||
ok, err = run(filepath.Join(env.root, "elevate.cmd"), append([]string{"cmd", "/C", name}, arg...)...)
|
||||
}
|
||||
|
||||
return ok, err
|
||||
}
|
||||
|
||||
func run(name string, arg ...string) (bool, error) {
|
||||
|
||||
Reference in New Issue
Block a user