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:
@ -83,6 +83,11 @@ fn main() {
|
|||||||
}
|
}
|
||||||
mut files := []string{}
|
mut files := []string{}
|
||||||
for file in possible_files {
|
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') {
|
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"')
|
verror('v fmt can only be used on .v files.\nOffending file: "$file"')
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user