Skip to content

Commit

Permalink
🚑 Add check for (new) requirement for NVD API key
Browse files Browse the repository at this point in the history
  • Loading branch information
pmonks committed Jan 17, 2024
1 parent 212a973 commit e178114
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pbr/tasks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@
:nvd -- opt: a map containing nvd-clojure-specific configuration options. See https://github.com/rm-hull/nvd-clojure#configuration-options"
[opts]
(when (s/blank? (System/getenv "NVD_API_TOKEN"))
(throw (ex-info "The NVD_API_TOKEN environment variable was not set. See https://github.com/rm-hull/nvd-clojure#configuration-options for more details about how to obtain an NVD API key." {})))
(println "ℹ️ Running NVD vulnerability checker (this can take a while)...")
(flush)
; Notes: NVD *cannot* be run in a directory containing a deps.edn, as this "pollutes" the classpath of the JVM it's running in; something it is exceptionally sensitive to.
Expand All @@ -383,6 +385,7 @@
(try
(delete-dir output-dir)
(delete-dir ".nvd")
(io/make-parents (str output-dir "/dummy-child.txt"))
(io/make-parents ".nvd/.")
(spit ".nvd/nvd-options.json"
(json/write-str {:delete-config? false
Expand Down

0 comments on commit e178114

Please sign in to comment.