simple-ssh
Advanced tools
Comparing version 0.7.3 to 0.7.4
@@ -22,2 +22,3 @@ 'use strict'; | ||
pass: '', | ||
key: '', | ||
baseDir: '' | ||
@@ -33,2 +34,3 @@ }, config); | ||
this.pass = config.pass; | ||
this.key = config.key; | ||
this.baseDir = config.baseDir; | ||
@@ -178,9 +180,24 @@ }; | ||
}); | ||
self._c.connect({ | ||
host: self.host, | ||
port: self.port || 22, | ||
username: self.user, | ||
password: self.pass | ||
}); | ||
if (self.pass && !self.key) { | ||
self._c.connect({ | ||
host: self.host, | ||
port: self.port || 22, | ||
username: self.user, | ||
password: self.pass | ||
}); | ||
} else if (!self.pass && self.key) { | ||
self._c.connect({ | ||
host: self.host, | ||
port: self.port || 22, | ||
username: self.user, | ||
privateKey: self.key | ||
}); | ||
}else if (self.pass && self.key) { | ||
self._c.connect({ | ||
host: self.host, | ||
port: self.port || 22, | ||
username: self.user, | ||
password: self.pass | ||
}); | ||
} | ||
}; | ||
@@ -187,0 +204,0 @@ |
{ | ||
"name": "simple-ssh", | ||
"version": "0.7.3", | ||
"version": "0.7.4", | ||
"description": "A wrapper for ssh2 to make it easier to perform commands over SSH", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
24587
490