tools: fix shortcut creation error in `v symlink` on windows (#8935)

pull/8954/head
Ben-Fields 2021-02-24 06:40:17 -06:00 committed by GitHub
parent 66c85aa5cb
commit 63ed3c0d41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -49,9 +49,10 @@ fn setup_symlink_windows(vexe string) {
vsymlinkdir := os.join_path(vdir, '.bin')
mut vsymlink := os.join_path(vsymlinkdir, 'v.exe')
if !os.exists(vsymlinkdir) {
os.mkdir_all(vsymlinkdir) or { panic(err) } // will panic if fails
os.mkdir(vsymlinkdir) or { panic(err) } // will panic if fails
} else {
os.rm(vsymlink) or { panic(err) }
os.rmdir(vsymlinkdir) or { panic(err) }
os.mkdir(vsymlinkdir) or { panic(err) }
}
// First, try to create a native symlink at .\.bin\v.exe
os.symlink(vsymlink, vexe) or {