Skip to content

Commit 74a040a

Browse files
jdbruijnbcoe
authored andcommitted
feat: update commit msg for when using commitAll (#320)
we now indicate that staged files have been included in release in output.
1 parent aad6a61 commit 74a040a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

lib/lifecycles/commit.js

+6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ function execCommit (args, newVersion) {
3131
toAdd += ' ' + path.relative(process.cwd(), p)
3232
}
3333
})
34+
35+
if (args.commitAll) {
36+
msg += ' and %s'
37+
paths.push('all staged files')
38+
}
39+
3440
checkpoint(args, msg, paths)
3541
return runExec(args, 'git add' + toAdd + ' ' + args.infile)
3642
.then(() => {

test.js

+12
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,18 @@ describe('cli', function () {
667667
result.stdout.should.not.match(/npm publish/)
668668
})
669669

670+
it('does not display `all staged files` without the --commit-all flag', function () {
671+
var result = execCli()
672+
result.code.should.equal(0)
673+
result.stdout.should.not.match(/and all staged files/)
674+
})
675+
676+
it('does display `all staged files` if the --commit-all flag is passed', function () {
677+
var result = execCli('--commit-all')
678+
result.code.should.equal(0)
679+
result.stdout.should.match(/and all staged files/)
680+
})
681+
670682
it('includes merge commits', function () {
671683
var branchName = 'new-feature'
672684
commit('feat: first commit')

0 commit comments

Comments
 (0)