Skip to content

Commit

Permalink
Add warning and skip SCA scan when directory path doesn't exists (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman authored May 23, 2024
1 parent 3bf5f3e commit afc7409
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions commands/audit/scarunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func runScaScan(params *AuditParams, results *xrayutils.Results) (err error) {
// Calculate the scans to preform
func getScaScansToPreform(params *AuditParams) (scansToPreform []*xrayutils.ScaScanResult) {
for _, requestedDirectory := range params.workingDirs {
if !fileutils.IsPathExists(requestedDirectory, false) {
log.Warn("The working directory", requestedDirectory, "doesn't exist. Skipping SCA scan...")
continue
}
// Detect descriptors and technologies in the requested directory.
techToWorkingDirs, err := coreutils.DetectTechnologiesDescriptors(requestedDirectory, params.IsRecursiveScan(), params.Technologies(), getRequestedDescriptors(params), sca.GetExcludePattern(params.AuditBasicParams))
if err != nil {
Expand Down

0 comments on commit afc7409

Please sign in to comment.