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

Fix module import errors by checking dirs with dir_exists

This commit is contained in:
AtjonTV 2019-07-30 19:47:42 +02:00 committed by Alexander Medvednikov
parent 79be98d2fb
commit 5b68e2ff50

View File

@ -946,7 +946,7 @@ fn (v mut V) add_user_v_files() {
idir := os.getwd() idir := os.getwd()
mut import_path := '$idir/$mod_path' mut import_path := '$idir/$mod_path'
//if !os.file_exists(import_path) || !os.is_dir(import_path){ //if !os.file_exists(import_path) || !os.is_dir(import_path){
if !os.is_dir(import_path){ if !os.dir_exists(import_path){
import_path = '$v.lang_dir/vlib/$mod_path' import_path = '$v.lang_dir/vlib/$mod_path'
} }
vfiles := v.v_files_from_dir(import_path) vfiles := v.v_files_from_dir(import_path)
@ -984,7 +984,7 @@ fn (v mut V) add_user_v_files() {
if v.pref.build_mode == .default_mode || v.pref.build_mode == .build { if v.pref.build_mode == .default_mode || v.pref.build_mode == .build {
module_path = '$ModPath/vlib/$mod_p' module_path = '$ModPath/vlib/$mod_p'
} }
if !os.is_dir(module_path) { if !os.dir_exists(module_path) {
module_path = '$v.lang_dir/vlib/$mod_p' module_path = '$v.lang_dir/vlib/$mod_p'
} }
vfiles := v.v_files_from_dir(module_path) vfiles := v.v_files_from_dir(module_path)