Skip to content

Commit 518a3fb

Browse files
committed
Allow clj-ssh to work with a wide range of slingshot versions
Tested with slingshot 0.2.0 and 0.10.1
1 parent 279b398 commit 518a3fb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<dependency>
9595
<groupId>slingshot</groupId>
9696
<artifactId>slingshot</artifactId>
97-
<version>0.10.0</version>
97+
<version>${slingshot.version}</version>
9898
</dependency>
9999
<dependency>
100100
<groupId>org.clojure</groupId>
@@ -155,5 +155,6 @@
155155
<properties>
156156
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
157157
<clojure.version>1.2.0</clojure.version>
158+
<slingshot.version>0.2.0</slingshot.version>
158159
</properties>
159160
</project>

src/clj_ssh/ssh.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ Licensed under EPL (http://www.eclipse.org/legal/epl-v10.html)"
4343
[clojure.java.io :as io]
4444
[clojure.string :as string]
4545
[clojure.tools.logging :as logging])
46-
(:use
47-
[slingshot.slingshot :only [throw+]])
4846
(:import [com.jcraft.jsch
4947
JSch Session Channel ChannelShell ChannelExec ChannelSftp
5048
Identity IdentityFile Logger KeyPair]))
5149

50+
;; slingshot version compatability
51+
(try
52+
(use '[slingshot.slingshot :only [throw+]])
53+
(catch Exception _
54+
(use '[slingshot.core :only [throw+]])))
55+
5256
(def ^{:doc "SSH agent used to manage identities." :dynamic true}
5357
*ssh-agent*)
5458

0 commit comments

Comments
 (0)