mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: cleanup os.find_abs_path_of_executable/1
This commit is contained in:
@@ -1025,8 +1025,7 @@ pub fn find_abs_path_of_executable(exepath string) ?string {
|
|||||||
return os.real_path(exepath)
|
return os.real_path(exepath)
|
||||||
}
|
}
|
||||||
mut res := ''
|
mut res := ''
|
||||||
env_path_delimiter := if os.user_os() == 'windows' { ';' } else { ':' }
|
paths := os.getenv('PATH').split(path_delimiter)
|
||||||
paths := os.getenv('PATH').split(env_path_delimiter)
|
|
||||||
for p in paths {
|
for p in paths {
|
||||||
found_abs_path := os.join_path( p, exepath )
|
found_abs_path := os.join_path( p, exepath )
|
||||||
if os.exists( found_abs_path ) && os.is_executable( found_abs_path ) {
|
if os.exists( found_abs_path ) && os.is_executable( found_abs_path ) {
|
||||||
|
Reference in New Issue
Block a user