1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

symlink: create /usr/local/bin if it does not exist (#6621)

This commit is contained in:
Lukas Neubert 2020-10-16 09:55:55 +02:00 committed by GitHub
parent eab0974e7d
commit 7471e1fd05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,11 @@ fn main() {
} }
fn setup_symlink(vexe string) { fn setup_symlink(vexe string) {
mut link_path := '/usr/local/bin/v' link_dir := '/usr/local/bin'
if !os.exists(link_dir) {
os.mkdir_all(link_dir)
}
mut link_path := link_dir + '/v'
mut ret := os.exec('ln -sf $vexe $link_path') or { mut ret := os.exec('ln -sf $vexe $link_path') or {
panic(err) panic(err)
} }