mirror of
https://github.com/vlang/v.git
synced 2025-09-16 07:52:32 +03:00
tools: use os.symlink instead of system('ln -s') in v symlink
(#10769)
This commit is contained in:
parent
0a66d8dc10
commit
fe65cde03b
2 changed files with 5 additions and 6 deletions
|
@ -31,11 +31,10 @@ fn setup_symlink_unix(vexe string) {
|
|||
}
|
||||
link_path = link_dir + '/v'
|
||||
}
|
||||
ret := os.execute('ln -sf "$vexe" "$link_path"')
|
||||
if ret.exit_code == 0 {
|
||||
println('Symlink "$link_path" has been created')
|
||||
} else {
|
||||
os.rm(link_path) or {}
|
||||
os.symlink(vexe, link_path) or {
|
||||
eprintln('Failed to create symlink "$link_path". Try again with sudo.')
|
||||
exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue