Merge pull request #963 from Tester798/fix-symlink-detect

Fix symlink detect if it points to nothing
This commit is contained in:
Corey Butler
2023-04-13 21:45:25 +00:00
committed by GitHub

View File

@@ -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))