diff --git a/README.md b/README.md index 3f552bd..cf8ead4 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,8 @@ grunt.initConfig({ tagMessage: 'Version %VERSION%', push: true, pushTo: 'upstream', + gitPushOptions: '', + gitPushTagOptions: '', gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d', globalReplace: false, prereleaseName: false, @@ -138,6 +140,18 @@ Default value: `upstream` If `options.push` is set to a truthy value, which remote repo should it go to? This is what gets set as `remote` in the `git push {remote} {branch}` command. Use `git remote` to see the list of remote repo's you have listed. [Learn about remote repos](http://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) +#### options.gitPushOptions +Type: `String` +Default value: `` + +Options to use with `$ git push` + +#### options.gitPushTagOptions +Type: `String` +Default value: `` + +Options to use with `$ git push vx.y.z` + #### options.gitDescribeOptions Type: `String` Default value: `--tags --always --abbrev=1 --dirty=-d` diff --git a/tasks/bump.js b/tasks/bump.js index 53dad4e..40340bb 100644 --- a/tasks/bump.js +++ b/tasks/bump.js @@ -17,6 +17,8 @@ module.exports = function(grunt) { files: ['package.json'], gitCommitOptions: '', gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d', + gitPushOptions: '', + gitPushTagOptions: '', globalReplace: false, prereleaseName: false, metadata: '', @@ -227,7 +229,7 @@ module.exports = function(grunt) { var cmd; if (opts.push === 'git' && !opts.pushTo) { - cmd = 'git push'; + cmd = 'git push ' + opts.gitPushOptions; if (dryRun) { grunt.log.ok('bump-dry: ' + cmd); next(); @@ -254,12 +256,12 @@ module.exports = function(grunt) { cmd = []; if (opts.push === true || opts.push === 'branch') { - cmd.push('git push ' + opts.pushTo + ' ' + ref.trim()); + cmd.push('git push ' + opts.pushTo + ' ' + ref.trim() + ' ' + opts.gitPushOptions); } if (opts.createTag && (opts.push === true || opts.push === 'tag')) { var tagName = opts.tagName.replace('%VERSION%', globalVersion); - cmd.push('git push ' + opts.pushTo + ' ' + tagName); + cmd.push('git push ' + opts.pushTo + ' ' + tagName + ' ' + opts.gitPushTagOptions); } cmd = cmd.join(' && ');