From 7d5b6d2b48c693b59f0a6b9f02fcb545621b7beb Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 30 Jul 2021 03:24:36 +0300 Subject: [PATCH] fix running `v run file.v` in a current working folder containing a run/ subfolder --- vlib/v/pref/pref.v | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/v/pref/pref.v b/vlib/v/pref/pref.v index f823972dec..4462c18d97 100644 --- a/vlib/v/pref/pref.v +++ b/vlib/v/pref/pref.v @@ -620,9 +620,7 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences eprintln('Cannot save output binary in a .v file.') exit(1) } - if is_source_file(command) { - res.path = command - } else if command == 'run' { + if command == 'run' { res.is_run = true if command_pos + 2 > args.len { eprintln('v run: no v files listed') @@ -666,6 +664,8 @@ pub fn parse_args(known_external_commands []string, args []string) (&Preferences eprintln('It looks like you wanted to run "${res.path}.v", so we went ahead and did that since "$res.path" is an executable.') res.path += '.v' } + } else if is_source_file(command) { + res.path = command } if !res.is_bare && res.bare_builtin_dir != '' { eprintln('`-bare-builtin-dir` must be used with `-freestanding`')