1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

builder: allow running symlinked .vsh files (#9385)

This commit is contained in:
Larpon 2021-03-20 17:25:09 +01:00 committed by GitHub
parent 517c1841c1
commit b7a0c44f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,7 @@ fn (mut v Builder) cleanup_run_executable_after_exit(exefile string) {
v.pref.vrun_elog('keeping executable: $exefile , because -keepc was passed')
return
}
if os.is_file(exefile) {
if os.is_executable(exefile) {
v.pref.vrun_elog('remove run executable: $exefile')
os.rm(exefile) or { panic(err) }
}
@ -273,8 +273,10 @@ pub fn (v &Builder) get_user_files() []string {
exit(1)
}
is_real_file := does_exist && !os.is_dir(dir)
if is_real_file && (dir.ends_with('.v') || dir.ends_with('.vsh') || dir.ends_with('.vv')) {
single_v_file := dir
resolved_link := if is_real_file && os.is_link(dir) { os.real_path(dir) } else { dir }
if is_real_file && (dir.ends_with('.v') || resolved_link.ends_with('.vsh')
|| dir.ends_with('.vv')) {
single_v_file := if resolved_link.ends_with('.vsh') { resolved_link } else { dir }
// Just compile one file and get parent dir
user_files << single_v_file
if v.pref.is_verbose {