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))))))))
(def ^:private load-profiles
"Load profiles.clj from your Leiningen home if present."
(memoize
(fn []
(try (utils/read-file (io/file (leiningen-home) "profiles.clj"))
(catch Exception e
(binding [*out* *err*]
(println "Error reading profiles.clj from" (leiningen-home))
(println (.getMessage e))))))))
(defn profiles (defn profiles
"Load profiles.clj from your Leiningen home if present." "Load profiles.clj from your Leiningen home if present."
[] []
(try (utils/read-file (io/file (leiningen-home) "profiles.clj")) (load-profiles))
(catch Exception e
(binding [*out* *err*]
(println "Error reading profiles.clj from" (leiningen-home))
(println (.getMessage e))))))
(defn gpg-program (defn gpg-program
"Lookup the gpg program to use, defaulting to 'gpg'" "Lookup the gpg program to use, defaulting to 'gpg'"