Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

supports leiningen 2 exit code strategy for tasks #13

Merged
merged 2 commits into from

2 participants

@slagyr

No description provided.

@ato ato merged commit e694fc1 into from
@ato
Owner

0.9.1 released. Thanks. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 16 additions and 7 deletions.
  1. +2 −2 README.md
  2. +1 −1  project.clj
  3. +13 −4 src/leiningen/push.clj
View
4 README.md
@@ -9,11 +9,11 @@ Setup
Add lein-clojars as a Leiningen (1.x) plugin:
- lein plugin install lein-clojars 0.9.0
+ lein plugin install lein-clojars 0.9.1
Or for Leiningen 2 add it to ~/.lein/profiles.clj:
- {:user {:plugins [[lein-clojars "0.9.0"]]}}
+ {:user {:plugins [[lein-clojars "0.9.1"]]}}
Create a Clojars account and paste your SSH public key into your [profile] [1].
If you don't have ssh-keygen available -- perhaps you're using Windows --
View
2  project.clj
@@ -1,3 +1,3 @@
-(defproject lein-clojars "0.9.0"
+(defproject lein-clojars "0.9.1"
:description "Leiningen plugin for interacting with Clojars.org."
:dependencies [[com.jcraft/jsch "0.1.42"]])
View
17 src/leiningen/push.clj
@@ -7,9 +7,9 @@
(let [re-repo #"(?:([^@]+)@)?([^:]+)(?::(\d+))?(?::(.*))?"]
(defn parse-repo [repo]
- (let [[_ user host port path] (re-matches re-repo
+ (let [[_ user host port path] (re-matches re-repo
(or repo "clojars@clojars.org"))]
- [(or user (System/getProperty "user.name"))
+ [(or user (System/getProperty "user.name"))
host
(if port (Integer/parseInt port) 22)
(or path ".")])))
@@ -64,6 +64,13 @@
(.disconnect channel)
(.disconnect session)))))
+(defn- exit [code]
+ (try
+ (require 'leiningen.core.main)
+ ((ns-resolve (the-ns 'leiningen.core.main) 'exit) code)
+ (catch java.io.FileNotFoundException e
+ code)))
+
(defn push
"Push a jar to the Clojars.org repository over scp"
[project & [repo]]
@@ -78,14 +85,16 @@
(jar project)
(try
(scp-send repo pomfile jarfile)
+ (exit 0)
(catch JSchException e
(.printStackTrace e)
(when (= (.getMessage e) "Auth fail")
- (println
+ (println
(str
"\nIf you're having trouble authenticating, try using\n"
"a key generated by 'lein keygen'. lein-clojars doesn't\n"
"work yet with DSA or passphrased keys. I'm working\n"
"on fixing this. You can also push directly with scp:\n\n"
"lein pom\n"
- "scp " pomfile " " jarfile " clojars@clojars.org:" )))))))
+ "scp " pomfile " " jarfile " clojars@clojars.org:" )))
+ (exit -1)))))
Something went wrong with that request. Please try again.