Skip to content

Commit

Permalink
Continue loading hooks if one happens to fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Feb 14, 2011
1 parent 727781e commit 583431c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/leiningen/core.clj
Expand Up @@ -135,14 +135,13 @@
(namespaces-matching "leiningen.hooks")))))

(defn- load-hooks [project]
(try (doseq [n (hook-namespaces project)]
(require n))
(catch Exception e
(when-not (empty? (.list (File. "lib")))
(println "Warning: problem requiring hooks:" (.getMessage e))
(when (System/getenv "DEBUG")
(.printStackTrace e))
(println "...continuing without hooks completely loaded.")))))
(doseq [n (hook-namespaces project)]
(try (require n)
(catch Exception e
(when-not (empty? (.list (File. "lib")))
(println "Warning: problem requiring" n "hook:" (.getMessage e))
(when (System/getenv "DEBUG")
(.printStackTrace e)))))))

(defn user-init []
(let [init-file (File. (home-dir) "init.clj")]
Expand Down

0 comments on commit 583431c

Please sign in to comment.