Skip to content

Commit

Permalink
fix: side effects
Browse files Browse the repository at this point in the history
  • Loading branch information
georgiee committed Mar 28, 2019
1 parent 8df9a43 commit 8a414ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/lifecycles/commit.js
Expand Up @@ -20,12 +20,12 @@ module.exports = function (args, newVersion) {
function execCommit (args, newVersion) {
var msg = 'committing %s'
var paths = []
var toAdd = ' '
var toAdd = ''

// only start with a pre-populated paths list when CHANGELOG processing is not skipped
if (!args.skip.changelog) {
paths = [args.infile]
toAdd += args.infile + ' '
toAdd += args.infile
}

var verify = args.verify === false || args.n ? '--no-verify ' : ''
Expand All @@ -43,6 +43,12 @@ function execCommit (args, newVersion) {
}
})
checkpoint(args, msg, paths)

if (args.skip.changelog && args.skip.bump && toAdd.length === 0) {
// nothing to do
return Promise.resolve()
}

return runExec(args, 'git add' + toAdd)
.then(() => {
return runExec(args, 'git commit ' + verify + (args.sign ? '-S ' : '') + (args.commitAll ? '' : (toAdd)) + ' -m "' + formatCommitMessage(args.message, newVersion) + '"')
Expand Down

0 comments on commit 8a414ca

Please sign in to comment.