aboutsummaryrefslogtreecommitdiff
path: root/Gruntfile.js
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2013-11-01 18:15:25 -0700
committerChris Rebert <[email protected]>2013-11-04 11:22:30 -0800
commit0bb122a377bc2c809a7ce64fb740ee9620b4b72e (patch)
tree83973769717638af66e07d583c0efa2a6f4332fe /Gruntfile.js
parent4e0d022de5b0d27b063156533dfcc248fc08257e (diff)
downloadbootstrap-0bb122a377bc2c809a7ce64fb740ee9620b4b72e.tar.xz
bootstrap-0bb122a377bc2c809a7ce64fb740ee9620b4b72e.zip
add Grunt task to change version numbers; fixes #11332
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 97f4ec4c0..c3016a2b0 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({
@@ -156,6 +157,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 +185,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 +216,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')