Skip to content

Commit

Permalink
Add debug log for zip file content (#5152)
Browse files Browse the repository at this point in the history
Co-authored-by: thtri <[email protected]>
  • Loading branch information
hubadr and thtri authored Oct 17, 2024
1 parent 34a60da commit b317b1d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/checkmarxOneExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -943,12 +943,15 @@ func (c *checkmarxOneExecuteScanHelper) zipFolder(source string, zipFile io.Writ
return nil
}

fileName := strings.TrimPrefix(path, baseDir)
noMatch, err := c.isFileNotMatchingPattern(patterns, path, info, utils)
if err != nil || noMatch {
if noMatch {
log.Entry().Debugf("Excluded %s", fileName)
}
return err
}

fileName := strings.TrimPrefix(path, baseDir)
writer, err := archive.Create(fileName)
if err != nil {
return err
Expand All @@ -960,6 +963,9 @@ func (c *checkmarxOneExecuteScanHelper) zipFolder(source string, zipFile io.Writ
}
defer file.Close()
_, err = io.Copy(writer, file)
if err == nil {
log.Entry().Debugf("Zipped %s", fileName)
}
fileCount++
return err
})
Expand Down

0 comments on commit b317b1d

Please sign in to comment.