From 93c8ae7cceace786fce57cc636f37e729f275b4e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 6 Dec 2013 22:26:02 +0000 Subject: [PATCH] Print debug messages from ssh2 when =--debug= option is passed. Fixes #31 --- README.md | 2 +- tasks/sftp.js | 3 +++ tasks/sshexec.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 158da9c..63762f0 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ Determins if the task should stop or continue if any of the commands returns a c If true only display remote error messages if Grunt is run with the --verbose flag. ## Release History -* 2013/XX/XX - v0.9.0 - [#28:](https://github.com/andrewrjones/grunt-ssh/issues/28) Pseudo-TTY support; [#40:](https://github.com/andrewrjones/grunt-ssh/issues/40) Add trailing slash to path if needed. +* 2013/XX/XX - v0.9.0 - [#28:](https://github.com/andrewrjones/grunt-ssh/issues/28) Pseudo-TTY support; [#40:](https://github.com/andrewrjones/grunt-ssh/issues/40) Add trailing slash to path if needed; [#31:](https://github.com/andrewrjones/grunt-ssh/issues/31) Print debug messages from ssh2 when =--debug= option is passed. * 2013/11/17 - v0.8.0 - [#33:](https://github.com/andrewrjones/grunt-ssh/pull/33) File counter for `sftp` and `suppressRemoteErrors` option for `sshexec` ([David J. Bradshaw](https://github.com/davidjbradshaw)); [#34:](https://github.com/andrewrjones/grunt-ssh/pull/34) Use stat() instead of opendir() for checking existence of a dir ([Harri Hälikkä](https://github.com/harriha)); [#38:](https://github.com/andrewrjones/grunt-ssh/pull/34) Doc updates ([Alexandre Richonnier](https://github.com/heralight)). * 2013/10/17 - v0.7.0 - [#32:](https://github.com/andrewrjones/grunt-ssh/pull/32) Added command line options for username, password and passphrase ([David J. Bradshaw](https://github.com/davidjbradshaw)); Doc updates. * 2013/09/25 - v0.6.2 - Allow sftp task to use the shared sshconfig; Allow overriding sshconfig properties in the task config ([Andy Royle](https://github.com/andyroyle)). Document using the private key with `sshexec`. diff --git a/tasks/sftp.js b/tasks/sftp.js index 2cccc40..293c0b4 100644 --- a/tasks/sftp.js +++ b/tasks/sftp.js @@ -175,6 +175,9 @@ module.exports = function (grunt) { c.on('error', function (err) { grunt.log.error('Connection :: error :: ' + err); }); + c.on('debug', function (message) { + grunt.log.debug('Connection :: debug :: ' + message); + }); c.on('end', function () { grunt.verbose.writeln('Connection :: end'); }); diff --git a/tasks/sshexec.js b/tasks/sshexec.js index a2fb78e..e8394c3 100644 --- a/tasks/sshexec.js +++ b/tasks/sshexec.js @@ -67,6 +67,9 @@ module.exports = function (grunt) { c.on('error', function (err) { grunt.fail.warn('Connection :: error :: ' + err); }); + c.on('debug', function (message) { + grunt.log.debug('Connection :: debug :: ' + message); + }); c.on('end', function () { grunt.verbose.writeln('Connection :: end'); });