Skip to content

Commit

Permalink
fix output error (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mthbernardes authored Apr 8, 2022
1 parent 2aa0a46 commit 65d928c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/clj_watson/entrypoint.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@
(scan* (assoc opts :database-strategy "dependency-check")))

(defn scan [{:keys [fail-on-result output deps-edn-path] :as opts}]
(let [vulnerabilities (scan* opts)]
(let [vulnerabilities (scan* opts)
contains-vulnerabilities? (->> vulnerabilities
(map (comp empty? :vulnerabilities))
(some false?))]
(controller.output/generate vulnerabilities deps-edn-path output)
(if (and (-> vulnerabilities count (> 0)) fail-on-result)
(if (and contains-vulnerabilities? fail-on-result)
(System/exit 1)
(System/exit 0))))

Expand Down

0 comments on commit 65d928c

Please sign in to comment.