Permalink
Browse files

Remove some repetition

  • Loading branch information...
purcell authored and Licenser committed Aug 9, 2010
1 parent a14dc82 commit f17f608dc5675fc12ae7465501d19d7510aa9b85
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/leiningen/add.clj
View
@@ -91,8 +91,9 @@ with a numbered list of choices."
(if (and version (not-any? (partial = version) (:versions res)))
(println "Sorry; there is no version" version "for" (artifact-name res) ". Try one of:" (str-join ", " (:versions res)))
(let [[a v] [(artifact-name res) (if version version (latest-stable (:versions res)))]
- p (read-clj (str (:root project) "/project.clj"))]
+ project-clj-path (str (:root project) "/project.clj")
+ p (read-clj project-clj-path)]
(println "Adding:" a v)
- (with-open [o (writer (str (:root project) "/project.clj"))]
+ (with-open [o (writer project-clj-path)]
(binding [*out* o]
(pr (add-artifact p (if dev :dev-dependencies :dependencies) a v)))))))))

0 comments on commit f17f608

Please sign in to comment.