gulp-maven-deploy
Advanced tools
Comparing version 0.1.5 to 0.2.0
56
index.js
@@ -1,54 +0,2 @@ | ||
var gmd = require('maven-deploy'); | ||
var through = require('through2'); | ||
function hasValidConfig(options) { | ||
options = options || {}; | ||
if (!options.hasOwnProperty('config') || typeof options.config !== 'object') { | ||
throw new Error('Missing required property "config" object.'); | ||
} | ||
return true; | ||
} | ||
var deploy = function(options, callback) { | ||
if (hasValidConfig(options)) { | ||
return through.obj(function(file, enc, cb) { | ||
gmd.config(options.config); | ||
if (!options.config.hasOwnProperty('repositories')) { | ||
throw new Error('Missing repositories configuration'); | ||
} | ||
options.config.repositories.forEach(function(repo) { | ||
if (!repo.hasOwnProperty('id') || !repo.hasOwnProperty('url')) { | ||
throw new Error('Deploy required "id" and "url".'); | ||
} | ||
gmd.deploy(repo.id, options.config.snapshot, function(err) { | ||
if (cb) { | ||
cb(err); | ||
} | ||
}); | ||
if (callback) { | ||
callback(null); | ||
} | ||
}); | ||
}); | ||
} | ||
}; | ||
var install = function(options, callback) { | ||
if (hasValidConfig(options)) { | ||
return through.obj(function(file, enc, cb) { | ||
gmd.config(options.config); | ||
gmd.install(function(err) { | ||
if (cb) { | ||
cb(err); | ||
} | ||
}); | ||
if (callback) { | ||
callback(null); | ||
} | ||
}); | ||
} | ||
throw new Error('Invalid configuration'); | ||
}; | ||
module.exports.deploy = deploy.bind(this); | ||
module.exports.install = install.bind(this); | ||
module.exports.deploy = require('./lib/deploy'); | ||
module.exports.install = require('./lib/install'); |
{ | ||
"name": "gulp-maven-deploy", | ||
"version": "0.1.5", | ||
"version": "0.2.0", | ||
"description": "Simple gulp plugin for the maven-deploy module", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha && jshint index.js sample/**" | ||
"test": "mocha --require test/setup.js test/**/*Test.js && jshint index.js sample/**" | ||
}, | ||
@@ -22,2 +22,3 @@ "keywords": [ | ||
"dependencies": { | ||
"async": "^1.2.1", | ||
"maven-deploy": "^1.1.0", | ||
@@ -27,6 +28,10 @@ "through2": "^1.1.1" | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"jshint": "^2.8.0", | ||
"mocha": "^2.1.0", | ||
"referee": "^1.0.3" | ||
"referee": "^1.0.3", | ||
"sinon": "^1.14.1", | ||
"sinon-chai": "^2.8.0", | ||
"vinyl": "^0.5.0" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
39171
25
324
3
7
1
+ Addedasync@^1.2.1
+ Addedasync@1.5.2(transitive)
- Removedasync@3.2.6(transitive)