From 3de99d365e9381283c2f5ba4b7f5f93f52b5a416 Mon Sep 17 00:00:00 2001 From: Henrixounez Date: Fri, 6 Sep 2019 12:08:50 +0200 Subject: [PATCH] compiler: allows dir spelling with slash at the end --- compiler/main.v | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/main.v b/compiler/main.v index 227a2b27e1..4252ca45b8 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -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'