compiler: allows dir spelling with slash at the end

pull/1880/head
Henrixounez 2019-09-06 12:08:50 +02:00 committed by Alexander Medvednikov
parent 79d4d56fe5
commit 3de99d365e
1 changed files with 7 additions and 2 deletions

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'