Skip to content

Commit

Permalink
feat: update commit msg for when using commitAll (#320)
Browse files Browse the repository at this point in the history
we now indicate that staged files have been included in release in output.
  • Loading branch information
jdbruijn authored and bcoe committed Apr 8, 2019
1 parent aad6a61 commit 74a040a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/lifecycles/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ function execCommit (args, newVersion) {
toAdd += ' ' + path.relative(process.cwd(), p)
}
})

if (args.commitAll) {
msg += ' and %s'
paths.push('all staged files')
}

checkpoint(args, msg, paths)
return runExec(args, 'git add' + toAdd + ' ' + args.infile)
.then(() => {
Expand Down
12 changes: 12 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,18 @@ describe('cli', function () {
result.stdout.should.not.match(/npm publish/)
})

it('does not display `all staged files` without the --commit-all flag', function () {
var result = execCli()
result.code.should.equal(0)
result.stdout.should.not.match(/and all staged files/)
})

it('does display `all staged files` if the --commit-all flag is passed', function () {
var result = execCli('--commit-all')
result.code.should.equal(0)
result.stdout.should.match(/and all staged files/)
})

it('includes merge commits', function () {
var branchName = 'new-feature'
commit('feat: first commit')
Expand Down

0 comments on commit 74a040a

Please sign in to comment.