symlink: create /usr/local/bin if it does not exist (#6621)
parent
eab0974e7d
commit
7471e1fd05
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue