From d340cb0de50cea66d6a4c52a69b8447548d28f2b Mon Sep 17 00:00:00 2001 From: Anthony Grimes Date: Thu, 14 Feb 2013 11:05:29 -0800 Subject: [PATCH] Add an :only-install-snapshots option that prevents `lein install` of non-snapshots. --- src/leiningen/install.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/leiningen/install.clj b/src/leiningen/install.clj index d4007f99..b892b0b6 100644 --- a/src/leiningen/install.clj +++ b/src/leiningen/install.clj @@ -2,6 +2,7 @@ "Install the current project to the local repository." (:require [cemerick.pomegranate.aether :as aether] [leiningen.core.project :as project] + [leiningen.core.main :as main] [leiningen.jar :as jar] [leiningen.pom :as pom] [clojure.java.io :as io]) @@ -11,6 +12,9 @@ (defn install "Install current project to the local repository." [project] + (when (and (:only-install-snapshots project) + (not (pom/snapshot? project))) + (main/abort "Can only install snapshot artifacts when :only-install snapshots is set.")) (let [jarfiles (jar/jar project) pomfile (pom/pom project) local-repo (:local-repo project)]