feat(plugins): normalize plugins and have unified function signature
This commit is contained in:
+11
-9
@@ -1,16 +1,18 @@
|
||||
const SemanticReleaseError = require('./error')
|
||||
|
||||
module.exports = function (plugins, commits, lastRelease, cb) {
|
||||
const type = plugins.analyze(commits)
|
||||
plugins.analyze(commits, (err, type) => {
|
||||
if (err) return cb(err)
|
||||
|
||||
if (!type) {
|
||||
return cb(new SemanticReleaseError(
|
||||
'There are no relevant changes, so no new version is released',
|
||||
'ENOCHANGE'
|
||||
))
|
||||
}
|
||||
if (!type) {
|
||||
return cb(new SemanticReleaseError(
|
||||
'There are no relevant changes, so no new version is released',
|
||||
'ENOCHANGE'
|
||||
))
|
||||
}
|
||||
|
||||
if (!lastRelease.version) return cb(null, 'initial')
|
||||
if (!lastRelease.version) return cb(null, 'initial')
|
||||
|
||||
cb(null, type)
|
||||
cb(null, type)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user