Commits

dai_yamashita  committed 1e34a76

finish callback support.

  • Participants
  • Parent commits 09c83d8

Comments (0)

Files changed (5)

 syntax: glob
 .idea
+node_modules
+test
+.idea
+.hg
+test
+node_modules
 var fs    = require('fs');
 var path  = require('path');
 
-module.exports.upload = function(root_local, root_remote, force, excludes, ssh2opts) {
+module.exports.upload = function(root_local, root_remote, force, excludes, ssh2opts, callback) {
     
     var c = new Connection();
     c.on('connect', function() {
             if (err) throw err;
             sftp.on('end', function() {
                 util.log('SFTP :: SFTP session closed');
+                callback();
             });
 
             doit(root_local, root_remote, "", "", force, excludes, sftp, function(err) {
     });
     c.on('close', function(had_error) {
         util.log('Connection :: close');
+        callback();
     });
     c.connect(ssh2opts);
 }

File package.json

       "type": "MIT"
     }
   ],
-  "version": "0.0.1",
+  "version": "0.0.2",
   "engines": {
     "node": ">=0.8.1"
   },
       privateKey: require('fs').readFileSync('keys'),
       passphrase: ''
       /*
-      password: 'nodejsrules'
+      password: 'password'
       */
-    });
+    } ,function(result){
+        console.log('finish');
+});