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

compiler: when compiling a single .v file, check that it is not a folder

This commit is contained in:
Delyan Angelov 2020-03-19 08:07:02 +02:00 committed by GitHub
parent 9ef8499183
commit cc847f83a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -782,7 +782,8 @@ pub fn (v &V) get_user_files() []string {
user_files << single_test_v_file
dir = os.base_dir(single_test_v_file)
}
if dir.ends_with('.v') || dir.ends_with('.vsh') {
is_real_file := os.exists(dir) && !os.is_dir(dir)
if is_real_file && ( dir.ends_with('.v') || dir.ends_with('.vsh') ) {
single_v_file := dir
// Just compile one file and get parent dir
user_files << single_v_file