Skip to content

Commit

Permalink
support renamed tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesús Carrera authored and drublic committed Dec 3, 2014
1 parent 2ab471e commit 1a37416
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### HEAD

* Support renamed tasks
* Prevent from releasing empty version numbers
* bump multiple files at once (fixes geddski/grunt-release#90)

Expand Down
12 changes: 7 additions & 5 deletions tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ 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 is in charge of master information, ie, it is it which define the base version to work on
file: grunt.config('pkgFile') || 'package.json',
Expand All @@ -27,17 +27,19 @@ module.exports = function(grunt){
push: true,
pushTags: true,
npm : true
});
}, grunt.config(this.name).options);

var config = setup(options.file, type);
var templateOptions = {
data: {
version: config.newVersion
}
};
var tagName = grunt.template.process(grunt.config.getRaw('release.options.tagName') || '<%= version %>', templateOptions);
var commitMessage = grunt.template.process(grunt.config.getRaw('release.options.commitMessage') || 'release <%= version %>', templateOptions);
var tagMessage = grunt.template.process(grunt.config.getRaw('release.options.tagMessage') || 'version <%= version %>', templateOptions);

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

var nowrite = grunt.option('no-write');
var indentation = grunt.option('indentation') || ' ';
var task = this;
Expand Down

0 comments on commit 1a37416

Please sign in to comment.