Permalink
Browse files

Documents and adjusts implementation of sshOptions.

  • Loading branch information...
1 parent 745a6ea commit 4989dd0d69ca11a4934c5b9aaea172742474c651 @tsmith committed Aug 14, 2010
Showing with 28 additions and 2 deletions.
  1. +7 −0 CHANGELOG
  2. +14 −0 README
  3. +7 −2 lib/host.js
View
@@ -1,3 +1,10 @@
+0.1.6
+- Document sshOptions and reimplement to allow setting in config or host object
+
+0.1.5
+- Remove errant console.log statement in ssh command
+- Log commands before launching subprocess instead of after
+
0.1.4
- Add sshOptions to host config to allow passing options to ssh on ssh()
- Add -r flag to scp() invocations to make useful for both files and directories
View
14 README
@@ -369,6 +369,20 @@ In your ssh config file (create if it does not exist):
~/.ssh/config
+To pass options to the ssh command when using ssh(), add the option or options
+as an array to the sshOptions property of the config, or concat the option or
+options to the host object sshOptions property prior to executing the command:
+
+ // Config task
+ config = {
+ user: 'mylogin',
+ sshOptions = [ '-2', '-p 44' ]
+ };
+
+ // Work task
+ host.sshOptions = host.sshOptions.concat('-v');
+
+
FEEDBACK
View
@@ -81,8 +81,14 @@ function log(message) {
var defaultLogPath = 'hosts.log';
function hostConstructor(config) {
+
+ // Initialize the sshOptions array here if not initialized in user-defined
+ // config task instead of inside constructor so that the host object
+ // sshOptions property points to a initially shared array in either case.
+ config.sshOptions = config.sshOptions || [];
+
// This function may get called with different config objects
- // during a single config task (see deployment example). Therefore
+ // during a single config task (see roles example in README). Therefore
// we cannot define the constructor as a function declaration at module
// scope and modify its prototype because the last config would become
// the config for all hosts.
@@ -91,7 +97,6 @@ function hostConstructor(config) {
this.address = address;
this.logger = new Log(this.address + ':', logPath, true);
this.log = log;
- this.sshOptions = [];
this.ssh = ssh;
this.scp = scp;

0 comments on commit 4989dd0

Please sign in to comment.