Add LEIN_SUPPRESS_USER_LEVEL_REPO_WARNINGS

Can be used to suppress warnings about repositories in user level profiles.  Also
adds the list of profiles containing :repositories when not suppressed.
This commit is contained in:
Hugo Duncan 2013-02-06 13:55:22 -05:00
parent ca9da99e5b
commit 7807740f8b

View file

@ -377,11 +377,17 @@
:else (or profile {}))) :else (or profile {})))
(defn- warn-user-repos [] (defn- warn-user-repos []
(when (->> (vals (user/profiles)) (let [profiles (filter #(->> (val %)
(map (comp second :repositories)) :repositories
(apply concat) (some :url)) vals
(println "WARNING: :repositories detected in user-level profile!") (some :url))
(println "See https://github.com/technomancy/leiningen/wiki/Repeatability"))) (user/profiles))]
(when (and (seq profiles)
(not (System/getenv "LEIN_SUPPRESS_USER_LEVEL_REPO_WARNINGS")))
(println
"WARNING: :repositories detected in user-level profiles!"
(vec (map key profiles)))
(println "See https://github.com/technomancy/leiningen/wiki/Repeatability"))))
(alter-var-root #'warn-user-repos memoize) (alter-var-root #'warn-user-repos memoize)