Skip to content

Commit

Permalink
Merge pull request coreybutler#963 from Tester798/fix-symlink-detect
Browse files Browse the repository at this point in the history
Fix symlink detect if it points to nothing
  • Loading branch information
coreybutler authored Apr 13, 2023
2 parents 3f0dba1 + 11625ec commit ee314da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ func use(version string, cpuarch string, reload ...bool) {
}

// Remove symlink if it already exists
sym, _ := os.Stat(env.symlink)
sym, _ := os.Lstat(env.symlink)
if sym != nil {
// _, err := runElevated(fmt.Sprintf(`"%s" cmd /C rmdir "%s"`, filepath.Join(env.root, "elevate.cmd"), filepath.Clean(env.symlink)))
_, err := elevatedRun("rmdir", filepath.Clean(env.symlink))
Expand Down

0 comments on commit ee314da

Please sign in to comment.