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

compiler: fix v command to accept '.v' as valid file

This commit is contained in:
Toby Webb 2019-10-12 02:03:37 +02:00 committed by Alexander Medvednikov
parent 51388fea75
commit f461a21a50

View File

@ -899,7 +899,7 @@ fn new_v(args[]string) &V {
exit(1)
}
// No -o provided? foo.v => foo
if out_name == 'a.out' && dir.ends_with('.v') {
if out_name == 'a.out' && dir.ends_with('.v') && dir != '.v' {
out_name = dir.left(dir.len - 2)
}
// if we are in `/foo` and run `v .`, the executable should be `foo`