Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ensure :dependencies and :dev-dependencies lists are always vectors, …

…since lists upset latest leiningen
  • Loading branch information...
commit d4c00848f8434f4eda41393f36bdaaededc4e677 1 parent 206e481
@purcell purcell authored committed
Showing with 14 additions and 8 deletions.
  1. +14 −8 src/leiningen/update.clj
View
22 src/leiningen/update.clj
@@ -6,14 +6,20 @@
[leiningen.update-repo :only [compare-versions]]))
-(defn update-artifact [project type artifact version]
- (reverse
- (first
- (reduce
- (fn [[form is-deps?] f]
- (if is-deps?
- [(cons (map (fn [[a v]] (if (= a (symbol artifact)) [a version] [a v])) f) form) false]
- [(cons f form) (= f type)])) ['() false] project))))
+(defn update-artifact [project dep-type artifact new-version]
+ (->> project
+ (reduce
+ (fn [[form prev] f]
+ (if (= prev dep-type)
+ [(cons (vec (for [[a v] f]
+ [a (if (= a (symbol artifact))
+ new-version
+ v)]))
+ form) nil]
+ [(cons f form) f]))
+ [() nil])
+ first
+ reverse))
(defn yes-or-no-prompt [question]
(print question " (y/n) ")
Please sign in to comment.
Something went wrong with that request. Please try again.