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

fmt: allow fmt to be run on directories (#6613)

This commit is contained in:
Enzo 2020-10-13 21:03:53 +02:00 committed by GitHub
parent ee0baf62ad
commit a2fba05218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,6 +83,11 @@ fn main() {
}
mut files := []string{}
for file in possible_files {
if os.is_dir(file) {
files << os.walk_ext(file, '.v')
files << os.walk_ext(file, '.vsh')
continue
}
if !file.ends_with('.v') && !file.ends_with('.vv') && !file.ends_with('.vsh') {
verror('v fmt can only be used on .v files.\nOffending file: "$file"')
continue