add validation in kubectl create if no file in directory

pull/8/head
xilabao 2017-06-29 14:04:43 +08:00 committed by Chen Rong
parent 637cc0a8ba
commit a9086f9b4f
1 changed files with 3 additions and 0 deletions

View File

@ -212,6 +212,9 @@ func (b *Builder) Path(recursive bool, paths ...string) *Builder {
b.paths = append(b.paths, visitors...)
}
if len(b.paths) == 0 && len(b.errs) == 0 {
b.errs = append(b.errs, fmt.Errorf("error reading %v: recognized file extensions are %v", paths, FileExtensions))
}
return b
}