android symlink fix
parent
9f31390ff1
commit
502ee8a56c
|
@ -1200,15 +1200,15 @@ pub fn create_symlink() {
|
||||||
}
|
}
|
||||||
vexe := vexe_path()
|
vexe := vexe_path()
|
||||||
mut link_path := '/usr/local/bin/v'
|
mut link_path := '/usr/local/bin/v'
|
||||||
mut ret := os.system('ln -sf $vexe $link_path')
|
mut ret := os.exec('ln -sf $vexe $link_path') or { panic(err) }
|
||||||
if ret == 0 {
|
if ret.exit_code == 0 {
|
||||||
println('Symlink "$link_path" has been created')
|
println('Symlink "$link_path" has been created')
|
||||||
}
|
}
|
||||||
else if os.system('uname -o | grep [A/a]ndroid') == 0 {
|
else if os.system('uname -o | grep -q \'[A/a]ndroid\'') == 0 {
|
||||||
println('Failed to create symlink "$link_path". Trying again with Termux path for Android.')
|
println('Failed to create symlink "$link_path". Trying again with Termux path for Android.')
|
||||||
link_path = '/data/data/com.termux/files/usr/bin/v'
|
link_path = '/data/data/com.termux/files/usr/bin/v'
|
||||||
ret = os.system('ln -sf $vexe $link_path')
|
ret = os.exec('ln -sf $vexe $link_path') or { panic(err) }
|
||||||
if ret == 0 {
|
if ret.exit_code == 0 {
|
||||||
println('Symlink "$link_path" has been created')
|
println('Symlink "$link_path" has been created')
|
||||||
} else {
|
} 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