From f95c94381822b70ba1723a90a2c4615f6f055d0e Mon Sep 17 00:00:00 2001 From: Mayhem Date: Wed, 19 Jun 2013 21:15:45 +0200 Subject: [PATCH] Update deps. --- Gruntfile.js | 32 +++++++++++++++++--------------- package.json | 6 +++--- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 38dc200ba..43c735333 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,9 +1,8 @@ module.exports = function(grunt) { - var pkg = grunt.file.readJSON('package.json'); var concatOptions = { process: { - data: pkg + get data() { return grunt.config('pkg'); } } }; var shellOptions = { @@ -14,7 +13,7 @@ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ - pkg: pkg, + pkg: grunt.file.readJSON('package.json'), concat: { coffee: { options: concatOptions, @@ -82,7 +81,7 @@ module.exports = function(grunt) { crx: { src: 'img/*.png', dest: 'builds/crx/', - expand: true, + expand: true, flatten: true } }, @@ -95,6 +94,14 @@ module.exports = function(grunt) { concurrent: { build: ['build-crx', 'build-userjs', 'build-userscript'] }, + bump: { + options: { + updateConfigs: ['pkg'], + commit: false, + createTag: false, + push: false + } + }, shell: { commit: { options: shellOptions, @@ -162,7 +169,9 @@ module.exports = function(grunt) { grunt.registerTask('default', ['build']); grunt.registerTask('set-build', 'Set the build type variable', function(type) { + var pkg = grunt.config('pkg'); pkg.type = type; + grunt.config('pkg', pkg); grunt.log.ok('pkg.type = %s', type); }); grunt.registerTask('build', ['concurrent:build']); @@ -190,22 +199,15 @@ module.exports = function(grunt) { ]); grunt.registerTask('release', ['shell:commit', 'shell:push', 'build-crx', 'compress:crx']); - grunt.registerTask('patch', ['bump', 'reloadPkg', 'updcl:3', 'release']); - grunt.registerTask('minor', ['bump:minor', 'reloadPkg', 'updcl:2', 'release']); - grunt.registerTask('major', ['bump:major', 'reloadPkg', 'updcl:1', 'release']); - - grunt.registerTask('reloadPkg', 'Reload the package', function() { - // Update the `pkg` object with the new version. - pkg = grunt.file.readJSON('package.json'); - grunt.config.data.pkg = concatOptions.process.data = pkg; - grunt.log.ok('pkg reloaded.'); - }); + grunt.registerTask('patch', ['bump', 'updcl:3', 'release']); + grunt.registerTask('minor', ['bump:minor', 'updcl:2', 'release']); + grunt.registerTask('major', ['bump:major', 'updcl:1', 'release']); grunt.registerTask('updcl', 'Update the changelog', function(i) { // i is the number of #s for markdown. + var pkg = grunt.config('pkg'); var version = new Array(+i + 1).join('#') + ' ' + pkg.version + ' - *' + grunt.template.today('yyyy-mm-dd') + '*'; grunt.file.write('CHANGELOG.md', version + '\n\n' + grunt.file.read('CHANGELOG.md')); grunt.log.ok('Changelog updated for v' + pkg.version + '.'); }); - }; diff --git a/package.json b/package.json index 0c838ac45..753d8763d 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ }, "devDependencies": { "grunt": "~0.4.1", - "grunt-bump": "~0.0.2", - "grunt-concurrent": "~0.2.0", + "grunt-bump": "~0.0.6", + "grunt-concurrent": "~0.3.0", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-coffee": "~0.7.0", - "grunt-contrib-compress": "~0.5.1", + "grunt-contrib-compress": "~0.5.2", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-watch": "~0.4.4",