builder: save the binary next to the source code again

pull/9441/head
Alexander Medvednikov 2021-03-23 14:50:50 +03:00
parent 6463dfca29
commit 11e1f42193
1 changed files with 3 additions and 1 deletions

View File

@ -46,7 +46,9 @@ pub fn (mut p Preferences) fill_with_defaults() {
// The file name is just `.v` or `.vsh` or `.*`
base = filename
}
// target_dir := if os.is_dir(rpath) { rpath } else { os.dir(rpath) }
target_dir := if os.is_dir(rpath) { rpath } else { os.dir(rpath) }
p.out_name = os.join_path(target_dir, base)
// TODO (maybe)
// If no "-o" was supplied, create the binary in the current
// directory. This is the behavior of Go, Clang, GCC, etc.
p.out_name = os.join_path(os.getwd(), base)