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

compiler: allows dir spelling with slash at the end

This commit is contained in:
Henrixounez 2019-09-06 12:08:50 +02:00 committed by Alexander Medvednikov
parent 79d4d56fe5
commit 3de99d365e

View File

@ -678,6 +678,9 @@ fn new_v(args[]string) &V {
if args.contains('run') {
dir = get_all_after(joined_args, 'run', '')
}
if dir.ends_with('/') {
dir = dir.all_before_last('/')
}
if args.len < 2 {
dir = ''
}
@ -690,8 +693,10 @@ fn new_v(args[]string) &V {
build_mode = .build
// v -lib ~/v/os => os.o
//mod = os.dir(dir)
if dir.contains('/') {
mod = dir.all_after('/')
mod = if dir.contains('/') {
dir.all_after('/')
} else {
dir
}
println('Building module "${mod}" (dir="$dir")...')
//out_name = '$TmpPath/vlib/${base}.o'