From 4ce8774d1a556408b46ebb24aa194f12abb67740 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Mon, 21 Jul 2014 11:56:09 -0700 Subject: [PATCH] Fix deploy task to work with signature files. --- src/leiningen/deploy.clj | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/leiningen/deploy.clj b/src/leiningen/deploy.clj index 2c3b871a..dbc43f04 100644 --- a/src/leiningen/deploy.clj +++ b/src/leiningen/deploy.clj @@ -11,7 +11,7 @@ [leiningen.jar :as jar] [leiningen.clean :as clean] [clojure.java.shell :as sh] - [clojure.string :as str])) + [clojure.string :as string])) (defn- abort-message [message] (cond (re-find #"Return code is 405" message) @@ -122,10 +122,17 @@ (-> (sh/sh "git" "rev-parse" "--abbrev-ref" "HEAD") :out butlast - str/join + string/join branches not)) +(defn- extension [f] + (if-let [[_ signed-extension] (re-find #"\.([a-z]+\.asc)$" f)] + signed-extension + (if (= "pom.xml" (.getName (io/file f))) + "pom" + (last (.split f "\\."))))) + (defn ^:no-project-needed deploy "Deploy jar and pom to remote repository. @@ -181,8 +188,7 @@ be able to depend on jars that are deployed without a pom." group-id (namespace identifier) repo (repo-for project repository) artifacts (for [f files] - [[:extension (if (= "pom.xml" (.getName (io/file f))) - "pom" (last (.split f "\\.")))] f])] + [[:extension (extension f)] f])] (main/debug "Deploying" files "to" repo) (aether/deploy :coordinates [(symbol group-id artifact-id) version]