Skip to content
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

support renamed tasks #35

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var semver = require('semver');
module.exports = function(grunt){
grunt.registerTask('release', 'bump version, git tag, git push, npm publish', function(type){
//defaults
var options = this.options({
var options = grunt.util._.extend({
bump: true,
file: grunt.config('pkgFile') || 'package.json',
add: true,
Expand All @@ -21,11 +21,10 @@ module.exports = function(grunt){
push: true,
pushTags: true,
npm : true
});

var tagName = grunt.config.getRaw('release.options.tagName') || '<%= version %>';
var commitMessage = grunt.config.getRaw('release.options.commitMessage') || 'release <%= version %>';
var tagMessage = grunt.config.getRaw('release.options.tagMessage') || 'version <%= version %>';
}, grunt.config(this.name).options);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious, what is the purpose of merging this.name in with the options?

var tagName = grunt.config.getRaw(this.name + '.options.tagName') || '<%= version %>';
var commitMessage = grunt.config.getRaw(this.name + '.options.commitMessage') || 'release <%= version %>';
var tagMessage = grunt.config.getRaw(this.name + '.options.tagMessage') || 'version <%= version %>';

var config = setup(options.file, type);
var templateOptions = {
Expand Down