Skip to content

Commit

Permalink
Improving buildDescriptorExcludeList for npm (#4976)
Browse files Browse the repository at this point in the history
Signed-off-by: Vijayan T <[email protected]>
  • Loading branch information
vijayanjay authored Jun 27, 2024
1 parent c3eeb33 commit 06df2d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/whitesource/configHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,19 @@ func (c *ConfigOptions) addBuildToolDefaults(config *ScanOptions, utils Utils) e
}

}
if config.BuildTool == "npm" {
if len(config.BuildDescriptorExcludeList) > 0 {
var excludePaths []string
for _, buildDescriptor := range config.BuildDescriptorExcludeList {
if strings.HasSuffix(buildDescriptor, "pom.xml") {
continue
}
modulePath, _ := filepath.Split(buildDescriptor)
excludePaths = append(excludePaths, modulePath)
}
*c = append(*c, ConfigOption{Name: "npm.ignoreDirectoryPatterns", Value: strings.Join(excludePaths, ",")})
}
}

if config.BuildTool == "docker" {
// for now only support default name of Dockerfile
Expand Down

0 comments on commit 06df2d4

Please sign in to comment.