Skip to content

Commit

Permalink
use stat
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 committed Aug 21, 2024
1 parent 7a27ae0 commit d46b5b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/compliance/spec/compliance.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func GetComplianceSpec(specNameOrPath string, c cache.TrivyCache) (ComplianceSpe
return ComplianceSpec{}, fmt.Errorf("error retrieving compliance spec from specified path: %w", err)
}
} else {
_, err := os.ReadFile(filepath.Join(c.GetChecksDir(), "metadata.json"))
_, err := os.Stat(filepath.Join(c.GetChecksDir(), "metadata.json"))
if err != nil { // cache corrupt or bundle does not exist, load embedded version
b = []byte(sp.NewSpecLoader().GetSpecByName(specNameOrPath))
log.Debug("Compliance spec loaded from embedded library", log.String("spec", specNameOrPath))
Expand Down

0 comments on commit d46b5b2

Please sign in to comment.