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:

committed by
Alexander Medvednikov

parent
4932a32d91
commit
270934441c
@ -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') {
|
||||
|
@ -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")')
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user