Skip to content

Commit

Permalink
🆕 Add note when explain is used with an artifact that is not a depend…
Browse files Browse the repository at this point in the history
…ency of the current project
  • Loading branch information
pmonks committed Dec 22, 2023
1 parent e52b95f commit 8606825
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tools_licenses/tasks.clj
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
(if ga
(if-let [version (lcd/dep->version dep)]
(do
(println (str "\n" (ansi/bold "Dependency: ") (str ga "@" version)))
(println (str "\n" (ansi/bold "Artifact: ") (str ga "@" version)))
(if (empty? dep-expr-info)
(explain-without-licenses! dep)
(explain-with-licenses! dep-expr-info)))
Expand Down Expand Up @@ -200,7 +200,9 @@
(if (= :explain output-type)
; Handle :output :explain separately, as it only needs license info for a single dependency, not all of them
(let [dep-ga (get opts :dep)
dep [dep-ga (get lib-map dep-ga)]
dep-info (get lib-map dep-ga)
_ (when-not dep-info (println (str "\n" (str (ansi/bold "Note: ") dep-ga " is not a dependency of this project"))))
dep [dep-ga dep-info]
dep-expr-info (lcd/dep->expressions-info dep)]
(explain-output! dep dep-expr-info))
; Other :output variants need all info for all dependencies
Expand Down

0 comments on commit 8606825

Please sign in to comment.