mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 17:03:17 +01: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
@ -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)
|
return nil, fmt.Errorf("failed to parse package.json file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !p.hasMinimumRequiredValues() {
|
if !p.hasNameAndVersionValues() {
|
||||||
log.Debug("encountered package.json file without the minimum number of field values required for" +
|
log.Debug("encountered package.json file without a name and/or version field, ignoring this file")
|
||||||
" consideration as a package")
|
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,6 +203,6 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
|
|||||||
return packages, nil
|
return packages, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p PackageJSON) hasMinimumRequiredValues() bool {
|
func (p PackageJSON) hasNameAndVersionValues() bool {
|
||||||
return p.Name != "" && p.Version != ""
|
return p.Name != "" && p.Version != ""
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user