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

os: make ls() return an optional

This commit is contained in:
Simon Ernst
2019-10-17 13:30:05 +02:00
committed by Alexander Medvednikov
parent 4932a32d91
commit 270934441c
8 changed files with 11 additions and 14 deletions

View File

@ -250,7 +250,7 @@ fn build_thirdparty_obj_file(path string, moduleflags []CFlag) {
}
println('$obj_path not found, building it...')
parent := os.dir(obj_path)
files := os.ls(parent)
files := os.ls(parent) or { panic(err) }
mut cfiles := ''
for file in files {
if file.ends_with('.c') {

View File

@ -499,7 +499,7 @@ pub fn (v &V) v_files_from_dir(dir string) []string {
} else if !os.dir_exists(dir) {
verror("$dir isn't a directory")
}
mut files := os.ls(dir)
mut files := os.ls(dir) or { panic(err) }
if v.pref.is_verbose {
println('v_files_from_dir ("$dir")')
}

View File

@ -100,7 +100,7 @@ fn find_windows_kit_root(host_arch string) ?WindowsKit {
// println(kit_lib)
files := os.ls(kit_lib)
files := os.ls(kit_lib) or { panic(err) }
mut highest_path := ''
mut highest_int := 0
for f in files {
@ -395,7 +395,7 @@ fn build_thirdparty_obj_file_with_msvc(path string, moduleflags []CFlag) {
println('$obj_path not found, building it (with msvc)...')
parent := os.dir(obj_path)
files := os.ls(parent)
files := os.ls(parent) or { panic(err) }
mut cfiles := ''
for file in files {