mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fix symlink for Termux on Android
This commit is contained in:
parent
fcc10d6358
commit
e87e5e33a7
@ -1199,12 +1199,21 @@ pub fn create_symlink() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
vexe := vexe_path()
|
vexe := vexe_path()
|
||||||
link_path := '/usr/local/bin/v'
|
mut link_path := '/usr/local/bin/v'
|
||||||
ret := os.system('ln -sf $vexe $link_path')
|
mut ret := os.system('ln -sf $vexe $link_path')
|
||||||
if ret == 0 {
|
if ret == 0 {
|
||||||
println('Symlink "$link_path" has been created')
|
println('Symlink "$link_path" has been created')
|
||||||
}
|
}
|
||||||
else {
|
else if os.system('uname -o | grep [A/a]ndroid') == 0 {
|
||||||
|
println('Failed to create symlink "$link_path". Trying again with Termux path for Android.')
|
||||||
|
link_path = '/data/data/com.termux/files/usr/bin/v'
|
||||||
|
ret = os.system('ln -sf $vexe $link_path')
|
||||||
|
if ret == 0 {
|
||||||
|
println('Symlink "$link_path" has been created')
|
||||||
|
} else {
|
||||||
|
println('Failed to create symlink "$link_path". Try again with sudo.')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
println('Failed to create symlink "$link_path". Try again with sudo.')
|
println('Failed to create symlink "$link_path". Try again with sudo.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user