Merge pull request #217 from bzz/single-file-add-vendor

CLI: always report vendoring for a single file
This commit is contained in:
Alexander 2019-04-08 11:41:05 +02:00 committed by GitHub
commit db6073efa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,6 +279,7 @@ func printFileAnalysis(file string, limit int64, isJSON bool) error {
fileType := getFileType(file, data)
language := enry.GetLanguage(file, data)
mimeType := enry.GetMIMEType(file, language)
vendored := enry.IsVendor(file)
if isJSON {
return json.NewEncoder(os.Stdout).Encode(map[string]interface{}{
@ -288,6 +289,7 @@ func printFileAnalysis(file string, limit int64, isJSON bool) error {
"type": fileType,
"mime": mimeType,
"language": language,
"vendored": vendored,
})
}
@ -296,8 +298,9 @@ func printFileAnalysis(file string, limit int64, isJSON bool) error {
type: %s
mime_type: %s
language: %s
vendored: %t
`,
filepath.Base(file), totalLines, nonBlank, fileType, mimeType, language,
filepath.Base(file), totalLines, nonBlank, fileType, mimeType, language, vendored,
)
return nil
}