Skip to content

Commit

Permalink
Updated elevation approach
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Oct 31, 2022
1 parent 9c2b3b4 commit f31dd2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 323 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Ecor Ventures LLC.
Copyright (c) 2022 Ecor Ventures LLC.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
321 changes: 0 additions & 321 deletions nvm.iss

This file was deleted.

7 changes: 6 additions & 1 deletion src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f31dd2a

Please sign in to comment.