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

pull/4072/head
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
1 changed files with 2 additions and 1 deletions

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