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

os: clean up file functions, use optionals

This commit is contained in:
Alexander Medvednikov
2019-07-03 21:07:42 +02:00
parent ffb4da791d
commit dec0d961f5
8 changed files with 107 additions and 64 deletions

View File

@@ -618,7 +618,7 @@ mut args := ''
println('linux cross compilation done. resulting binary: "$v.out_name"')
}
if !v.pref.is_debug && v.out_name_c != 'v.c' && v.out_name_c != 'v_macos.c' {
os.rm('$TmpPath/$v.out_name_c')
//os.rm('$TmpPath/$v.out_name_c')
}
}
@@ -882,7 +882,8 @@ fn new_v(args[]string) *V {
if os.file_exists(vroot_path) {
mut vroot := os.read_file(vroot_path) or {
break
}
}
//mut vroot := os.read_file(vroot_path)
vroot=vroot.trim_space()
if os.dir_exists(vroot) && os.dir_exists(vroot + '/vlib/builtin') {
lang_dir = vroot