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

added -user_mod_path command line option to add a module search path

This commit is contained in:
prime31
2019-11-28 02:04:57 -08:00
committed by Alexander Medvednikov
parent 7545ea709a
commit 208f67132d
2 changed files with 8 additions and 0 deletions

View File

@ -165,6 +165,9 @@ fn (v &V) find_module_path(mod string) ?string {
tried_paths << filepath.join(v.compiled_dir, 'modules', mod_path)
tried_paths << filepath.join(v.pref.vlib_path, mod_path)
tried_paths << filepath.join(modules_lookup_path, mod_path)
if v.pref.user_mod_path.len > 0 {
tried_paths << v.pref.user_mod_path
}
for try_path in tried_paths {
if v.pref.is_verbose { println(' >> trying to find $mod in $try_path ...') }
if os.dir_exists(try_path) {