0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

add Grunt task to change version numbers; fixes #11332

This commit is contained in:
Chris Rebert 2013-11-01 18:15:25 -07:00
parent 4e0d022de5
commit 0bb122a377
2 changed files with 20 additions and 0 deletions

View File

@ -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')

View File

@ -34,5 +34,7 @@
, "grunt-html-validation": "~0.1.6"
, "grunt-jekyll": "~0.4.0"
, "grunt-recess": "~0.4.0"
, "grunt-sed": "~0.1.1"
, "regexp-quote": "~0.0.0"
}
}