-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added support for commitAll option in CLI #121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love this idea, and the tests are great.
handledExec(argv, 'git add package.json ' + argv.infile, cb, function () { | ||
handledExec(argv, 'git commit ' + verify + (argv.sign ? '-S ' : '') + 'package.json ' + argv.infile + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () { | ||
handledExec(argv, 'git commit ' + verify + (argv.sign ? '-S ' : '') + (argv.commitAll ? '' : ('package.json ' + argv.infile)) + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is a bit messy. I'd like to use a variable. But doesn't have to be in this PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can refactor this in a separate PR.
@@ -101,9 +102,8 @@ function commit (argv, newVersion, cb) { | |||
args.unshift('package.json') | |||
} | |||
checkpoint(argv, msg, args) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems a bit unnecessary to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it wasn't intentional. I'll remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK I readded the whitespace, not sure why but it's not showing up in the diff here.
Generally LGTM :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The empty line change seems a bit weird, but otherwise LGTM! Thanks for your contribution.
handledExec(argv, 'git add package.json ' + argv.infile, cb, function () { | ||
handledExec(argv, 'git commit ' + verify + (argv.sign ? '-S ' : '') + 'package.json ' + argv.infile + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () { | ||
handledExec(argv, 'git commit ' + verify + (argv.sign ? '-S ' : '') + (argv.commitAll ? '' : ('package.json ' + argv.infile)) + ' -m "' + formatCommitMessage(argv.message, newVersion) + '"', cb, function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can refactor this in a separate PR.
@@ -92,6 +92,29 @@ describe('cli', function () { | |||
content.should.match(/1\.0\.1/) | |||
content.should.not.match(/legacy header format/) | |||
}) | |||
|
|||
it('commits all staged files', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the test, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks :)
can we merge this guys? our builds are doing 2 commits per build and it'd be really nice to updated to this ASAP :) |
Thanks @bcoe does this get automatically published to npm? |
@benmonro this is the dream eventually: https://github.com/bcoe/travis-deploy-example But currently there's some meat in the machine, give me 5 minutes. |
👍 Thanks! |
@benmonro give this a spin:
|
npm version will commit any staged files as part of it's execution. This feature adds the option to support that in build server scenarios where a build step needs to commit other files besides just package & changelog. the default behavior is preserved, so this is an opt in feature.