mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compile: infer source file if a binary by the same name exists in same dir #6877
This commit is contained in:
parent
268e3b5d15
commit
f807fd973e
@ -409,6 +409,11 @@ pub fn parse_args(args []string) (&Preferences, string) {
|
||||
res.path = args[command_pos + 1]
|
||||
res.run_args = args[command_pos + 2..]
|
||||
must_exist(res.path)
|
||||
if !res.path.ends_with('.v') && os.is_executable(res.path) && os.is_file(res.path) &&
|
||||
os.is_file(res.path + '.v') {
|
||||
eprintln('It looks like you wanted to run `v $res.path`, so we went ahead and did that since "$res.path" is an executable.')
|
||||
res.path += '.v'
|
||||
}
|
||||
}
|
||||
if command == 'build-module' {
|
||||
res.build_mode = .build_module
|
||||
|
Loading…
Reference in New Issue
Block a user