From 3bed88c05a69c420741694cb70b245bacef1b716 Mon Sep 17 00:00:00 2001 From: manegron Date: Thu, 15 Oct 2026 11:03:19 +0100 Subject: [PATCH] Fix script --- resources/scripts/rb_ingest_vuln_cve_pg.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/scripts/rb_ingest_vuln_cve_pg.rb b/resources/scripts/rb_ingest_vuln_cve_pg.rb index cde8e75..49490f4 100644 --- a/resources/scripts/rb_ingest_vuln_cve_pg.rb +++ b/resources/scripts/rb_ingest_vuln_cve_pg.rb @@ -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}")