Skip to content

Commit

Permalink
- Corrections for static analysis regressions.
Browse files Browse the repository at this point in the history
Signed-off-by: HeyeOpenSource <[email protected]>
  • Loading branch information
HeyeOpenSource committed Oct 24, 2024
1 parent 3ce5adf commit a92a4da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 3 additions & 0 deletions syft/pkg/cataloger/dotnet/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func DefaultCatalogerConfig() CatalogerConfig {

func (g CatalogerConfig) WithSearchLocalLicenses(input bool) CatalogerConfig {
g.SearchLocalLicenses = input
if input && len(g.LocalCachePaths) == 0 {
g.WithLocalCachePaths(getDefaultProviders())
}
return g
}

Expand Down
4 changes: 1 addition & 3 deletions syft/pkg/cataloger/dotnet/licenses.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,7 @@ func getNuGetCachesFromSDK() []string {
func (c *nugetLicenseResolver) getLocalNugetFolderResolvers(assetDefinitions []projectAssets) []file.Resolver {
nugetPackagePaths := []string{}
if len(c.opts.LocalCachePaths) > 0 {
for _, cachePath := range c.opts.LocalCachePaths {
nugetPackagePaths = append(nugetPackagePaths, cachePath)
}
nugetPackagePaths = append(nugetPackagePaths, c.opts.LocalCachePaths...)
} else {
nugetPackagePaths = append(nugetPackagePaths, getNuGetCachesFromProjectAssets(assetDefinitions)...)

Expand Down

0 comments on commit a92a4da

Please sign in to comment.