Skip to content

Commit

Permalink
skip missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlikelee committed Jan 1, 2025
1 parent 5a30b47 commit c60571c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/cve/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ func main() {
fileNameRaw := filepath.Join(*dbDir, fileFmt(suffix, "json", ""))
fileName := filepath.Join(*dbDir, fileFmt(suffix, "json", "gz"))
metaName := filepath.Join(*dbDir, fileFmt(suffix, "meta", ""))
// skip if file does not exist
if _, err := os.Stat(fileNameRaw); os.IsNotExist(err) {
logger.Log("msg", "Skipping metadata generation for missing file", "file", fileNameRaw)
continue
}
err := nvdsync.CompressFile(fileNameRaw, fileName)
if err != nil {
panic(err)
Expand Down

0 comments on commit c60571c

Please sign in to comment.