Memoize user/profiles.

This commit is contained in:
Jean Niklas L'orange 2013-01-23 18:08:27 +01:00
parent 0ef01ba38b
commit 730141f972

View file

@ -23,14 +23,20 @@
(catch Exception e (catch Exception e
(.printStackTrace e)))))))) (.printStackTrace e))))))))
(defn profiles (def ^:private load-profiles
"Load profiles.clj from your Leiningen home if present." "Load profiles.clj from your Leiningen home if present."
[] (memoize
(fn []
(try (utils/read-file (io/file (leiningen-home) "profiles.clj")) (try (utils/read-file (io/file (leiningen-home) "profiles.clj"))
(catch Exception e (catch Exception e
(binding [*out* *err*] (binding [*out* *err*]
(println "Error reading profiles.clj from" (leiningen-home)) (println "Error reading profiles.clj from" (leiningen-home))
(println (.getMessage e)))))) (println (.getMessage e))))))))
(defn profiles
"Load profiles.clj from your Leiningen home if present."
[]
(load-profiles))
(defn gpg-program (defn gpg-program
"Lookup the gpg program to use, defaulting to 'gpg'" "Lookup the gpg program to use, defaulting to 'gpg'"