feat(pre): pass more information to the verification hook
This commit is contained in:
parent
44db677c4a
commit
41c90124f6
@ -21,7 +21,7 @@
|
|||||||
"semver": "^4.3.3"
|
"semver": "^4.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"cracks": "^2.0.0",
|
"cracks": "^2.0.1",
|
||||||
"github-release-fake-server": "^1.3.0",
|
"github-release-fake-server": "^1.3.0",
|
||||||
"lodash.defaults": "^3.0.0",
|
"lodash.defaults": "^3.0.0",
|
||||||
"nano-uid": "^0.2.0",
|
"nano-uid": "^0.2.0",
|
||||||
|
10
src/pre.js
10
src/pre.js
@ -24,11 +24,12 @@ module.exports = function (options, plugins, cb) {
|
|||||||
pkg.version = res.version ? semver.inc(res.version, type) : '1.0.0'
|
pkg.version = res.version ? semver.inc(res.version, type) : '1.0.0'
|
||||||
|
|
||||||
var writePkg = function () {
|
var writePkg = function () {
|
||||||
if (!options.debug) fs.writeFileSync(path, JSON.stringify(pkg, null, 2))
|
if (!options.debug) fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n')
|
||||||
cb(null, pkg.version)
|
cb(null, pkg.version)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'major' || !plugins.verification) return writePkg()
|
if (!plugins.verification) return writePkg()
|
||||||
|
|
||||||
var opts = {}
|
var opts = {}
|
||||||
|
|
||||||
if (typeof plugins.verification === 'string') {
|
if (typeof plugins.verification === 'string') {
|
||||||
@ -38,6 +39,11 @@ module.exports = function (options, plugins, cb) {
|
|||||||
opts = plugins.verification
|
opts = plugins.verification
|
||||||
}
|
}
|
||||||
|
|
||||||
|
opts.type = type
|
||||||
|
opts.commits = commits
|
||||||
|
opts.version = res.version
|
||||||
|
opts.nextVersion = pkg.version
|
||||||
|
|
||||||
var verification = require(opts.name)
|
var verification = require(opts.name)
|
||||||
|
|
||||||
verification(opts, efh(cb)(function (ok) {
|
verification(opts, efh(cb)(function (ok) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user