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

pull/6635/head
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
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ fn main() {
}
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 {
panic(err)
}