compiler: -o dir/file: create a new directory if it doesn't exist
parent
e8d34002e1
commit
d5cf4d6fd5
|
@ -840,6 +840,15 @@ pub fn new_v(args[]string) &V {
|
||||||
base := os.getwd().all_after(os.path_separator)
|
base := os.getwd().all_after(os.path_separator)
|
||||||
out_name = base.trim_space()
|
out_name = base.trim_space()
|
||||||
}
|
}
|
||||||
|
// `v -o dir/exec`, create "dir/" if it doesn't exist
|
||||||
|
if out_name.contains(os.path_separator) {
|
||||||
|
d := out_name.all_before_last(os.path_separator)
|
||||||
|
println('DIRRR ' + d)
|
||||||
|
if !os.dir_exists(d) {
|
||||||
|
println('creating a new directory "$d"')
|
||||||
|
os.mkdir(d)
|
||||||
|
}
|
||||||
|
}
|
||||||
mut _os := OS.mac
|
mut _os := OS.mac
|
||||||
// No OS specifed? Use current system
|
// No OS specifed? Use current system
|
||||||
if target_os == '' {
|
if target_os == '' {
|
||||||
|
|
Loading…
Reference in New Issue