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

Checks if dir given exists and is a directory before ls

This commit is contained in:
Henrixounez
2019-06-23 14:59:44 +02:00
committed by Alex Medvednikov
parent ec87ca37fa
commit ad5e1fd8d4
2 changed files with 13 additions and 1 deletions

View File

@ -516,7 +516,7 @@ mut args := ''
fn (c &V) v_files_from_dir(dir string) []string {
mut res := []string
if !os.file_exists(dir) {
if !os.dir_exists(dir) {
panic('$dir doesn\'t exist')
}
mut files := os.ls(dir)