Skip to content

Commit

Permalink
Minor cleanup of make-repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jun 26, 2010
1 parent f5064be commit 8eb54a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/leiningen/deps.clj
Expand Up @@ -36,13 +36,13 @@
(defn make-repository [[id settings]]
(let [repo (RemoteRepository.)]
(.setId repo id)
(cond
(string? settings) (.setUrl repo settings)
(map? settings) (do (.setUrl repo (:url settings))
(let [server (doto (Server.)
(.setUsername (:username settings))
(.setPassword (:password settings)))]
(.addAuthentication repo (Authentication. server)))))
(if (string? settings)
(.setUrl repo settings)
(let [{:keys [url username password]}]
(.setUrl repo url)
(.addAuthentication repo (Authentication. (doto (Server.)
(.setUsername username)
(.setPassword password))))))
repo))

(defn get-repository-list [project]
Expand Down

0 comments on commit 8eb54a9

Please sign in to comment.