Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions resources/scripts/rb_ingest_vuln_cve_pg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,16 @@ def import_cve_files
# https://nvd.nist.gov/feeds/json/cve/2.0/nvdcve-2.0-#{year}.meta
# sha256sum = `curl -s #{url.sub('.json.gz', '.meta')} | grep 'sha256' | awk '{print $2}'`.strip

unless download_gz_file_with_retries(url, filename)
# Full paths: the script can be run from any directory
filepath = File.join(@download_path, filename)
unless download_gz_file_with_retries(url, filepath)
puts "ERROR: Could not download #{filename} after multiple attempts."
complete_download = false
break
end

filepath = @download_path + filename
`gzip -dkf #{filepath}`
file_json = filename.sub(/\.gz$/, '')
file_json = filepath.sub(/\.gz$/, '')

if File.exist?(file_json)
system("dos2unix #{file_json}")
Expand Down
Loading