mirror of
https://github.com/anchore/syft
synced 2024-11-10 14:24:12 +00:00
Clarify debug message for package.json omissions
Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
parent
9ec3ad58c8
commit
d5779a9822
1 changed files with 3 additions and 4 deletions
|
@ -174,9 +174,8 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
|
|||
return nil, fmt.Errorf("failed to parse package.json file: %w", err)
|
||||
}
|
||||
|
||||
if !p.hasMinimumRequiredValues() {
|
||||
log.Debug("encountered package.json file without the minimum number of field values required for" +
|
||||
" consideration as a package")
|
||||
if !p.hasNameAndVersionValues() {
|
||||
log.Debug("encountered package.json file without a name and/or version field, ignoring this file")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
@ -204,6 +203,6 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
|
|||
return packages, nil
|
||||
}
|
||||
|
||||
func (p PackageJSON) hasMinimumRequiredValues() bool {
|
||||
func (p PackageJSON) hasNameAndVersionValues() bool {
|
||||
return p.Name != "" && p.Version != ""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue