diff options
Diffstat (limited to 'Gruntfile.js')
| -rw-r--r-- | Gruntfile.js | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 97f4ec4c0..beacc3cc8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,7 @@ module.exports = function(grunt) { "use strict"; + RegExp.quote = require('regexp-quote') var btoa = require('btoa') // Project configuration. grunt.initConfig({ @@ -10,11 +11,9 @@ module.exports = function(grunt) { // Metadata. pkg: grunt.file.readJSON('package.json'), banner: '/*!\n' + - ' * Bootstrap v<%= pkg.version %> by @fat and @mdo\n' + + ' * Bootstrap v<%= pkg.version %> (http://getbootstrap.com)\n' + ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' + - ' *\n' + - ' * Designed and built with all the love in the world by @mdo and @fat.\n' + ' */\n\n', jqueryCheck: 'if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") }\n\n', @@ -134,8 +133,8 @@ module.exports = function(grunt) { options: { reset: true, relaxerror: [ - "Bad value X-UA-Compatible for attribute http-equiv on element meta.", - "Element img is missing required attribute src." + "Bad value X-UA-Compatible for attribute http-equiv on element meta.", + "Element img is missing required attribute src." ] }, files: { @@ -156,6 +155,17 @@ module.exports = function(grunt) { files: 'less/*.less', tasks: ['recess'] } + }, + + sed: { + versionNumber: { + pattern: (function () { + var old = grunt.option('oldver') + return old ? RegExp.quote(old) : old + })(), + replacement: grunt.option('newver'), + recursive: true + } } }); @@ -173,6 +183,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-html-validation'); grunt.loadNpmTasks('grunt-jekyll'); grunt.loadNpmTasks('grunt-recess'); + grunt.loadNpmTasks('grunt-sed'); // Docs HTML validation task grunt.registerTask('validate-html', ['jekyll', 'validation']); @@ -203,6 +214,11 @@ module.exports = function(grunt) { // Default task. grunt.registerTask('default', ['test', 'dist', 'build-customizer']); + // Version numbering task. + // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z + // This can be overzealous, so its changes should always be manually reviewed! + grunt.registerTask('change-version-number', ['sed']); + // task for building customizer grunt.registerTask('build-customizer', 'Add scripts/less files to customizer.', function () { var fs = require('fs') |
