1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-16 05:16:08 +02:00

Improving buildDescriptorExcludeList for npm (#4976)

Signed-off-by: Vijayan T <vijayanjay@gmail.com>
This commit is contained in:
Vijayan T 2024-06-27 16:06:31 +05:30 committed by GitHub
parent c3eeb3398e
commit 06df2d4463
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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