kezhenxu94 commented on a change in pull request #52:
URL: https://github.com/apache/skywalking-eyes/pull/52#discussion_r684602875



##########
File path: pkg/deps/npm.go
##########
@@ -206,10 +215,53 @@ func (resolver *NpmResolver) ResolvePkgFile(pkgFile 
string) (string, error) {
        if err != nil {
                return "", err
        }
-       if packageInfo.License == "" {
-               return "", fmt.Errorf("cannot capture the license field")
+
+       if lcs, ok := resolver.ResolveLicenseField(packageInfo.License); ok {
+               return lcs, nil
+       }
+
+       if lcs, ok := resolver.ResolveLicensesField(packageInfo.Licenses); ok {
+               return lcs, nil
+       }
+
+       return "", fmt.Errorf("cannot parse the \"license\"/\"licenses\" field")

Review comment:
       ```suggestion
        return "", fmt.Errorf(`cannot parse the "license"/"licenses" field`)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to