ftp-deploy
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -20,4 +20,6 @@ var fs = require('fs'); | ||
var thisDeployer = this; | ||
var toTransfer; | ||
this.toTransfer; | ||
this.transferred = 0; | ||
this.total = 0; | ||
var ftp; | ||
@@ -95,2 +97,3 @@ var localRoot; | ||
} else { | ||
thisDeployer.transferred++; | ||
thisDeployer.emit('uploaded', path.join(currPath, inFilename)); | ||
@@ -104,3 +107,3 @@ cb(); | ||
function ftpProcessLocation (inPath, cb) { | ||
if (!toTransfer[inPath]) { | ||
if (!thisDeployer.toTransfer[inPath]) { | ||
cb(new Error('Data for ' + inPath + ' not found')); | ||
@@ -114,3 +117,3 @@ } else { | ||
currPath = inPath; | ||
files = toTransfer[inPath]; | ||
files = thisDeployer.toTransfer[inPath]; | ||
async.forEach(files, ftpPut, function (err) { | ||
@@ -139,4 +142,4 @@ if (err) { | ||
ftp.useList = true; | ||
toTransfer = dirParseSync(localRoot); | ||
thisDeployer.toTransfer = dirParseSync(localRoot); | ||
// Authentication and main processing of files | ||
@@ -148,3 +151,7 @@ ftp.auth(config.username, config.password, function(err) { | ||
// Iterating through all location from the `localRoot` in parallel | ||
var locations = Object.keys(toTransfer); | ||
var locations = Object.keys(thisDeployer.toTransfer); | ||
// store total number of files to transfer | ||
thisDeployer.total = locations.length; | ||
async.forEachSeries(locations, ftpProcessLocation, function() { | ||
@@ -166,3 +173,3 @@ ftp.raw.quit(function(err) { | ||
if (typeof module !== 'undefined' && "exports" in module) { | ||
module.exports = new FtpDeployer(); | ||
module.exports = FtpDeployer; | ||
} |
{ | ||
"name": "ftp-deploy", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"author": "Rick Bergfalk <rick.bergfalk@gmail.com> (http://rickbergfalk.com/)", | ||
@@ -5,0 +5,0 @@ "description": "Ftp a folder from your local disk to an ftp destination. Does not delete from destination directory. Derived from grunt-ftp-deploy", |
@@ -10,4 +10,5 @@ # ftp-deploy | ||
``` | ||
var ftpDeploy = require('ftp-deploy'); | ||
```js | ||
var FtpDeploy = require('ftp-deploy'); | ||
var ftpDeploy = new FtpDeploy(); | ||
@@ -49,2 +50,2 @@ var config = { | ||
MIT | ||
MIT |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8492
142
50