0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-18 10:52:19 +01:00
This commit is contained in:
Chris Rebert 2014-01-17 11:51:53 -08:00
parent c5bed1a850
commit ffdc18cbbf

View File

@ -7,14 +7,14 @@ module.exports = function (grunt) {
grunt.util.linefeed = '\n'; grunt.util.linefeed = '\n';
RegExp.quote = function (string) { RegExp.quote = function (string) {
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&') return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
} };
var BsLessdocParser = require('./docs/grunt/bs-lessdoc-parser.js') var BsLessdocParser = require('./docs/grunt/bs-lessdoc-parser.js');
var fs = require('fs') var fs = require('fs');
var generateGlyphiconsData = require('./docs/grunt/bs-glyphicons-data-generator.js') var generateGlyphiconsData = require('./docs/grunt/bs-glyphicons-data-generator.js');
var generateRawFilesJs = require('./docs/grunt/bs-raw-files-generator.js') var generateRawFilesJs = require('./docs/grunt/bs-raw-files-generator.js');
var path = require('path') var path = require('path');
// Project configuration. // Project configuration.
grunt.initConfig({ grunt.initConfig({
@ -325,8 +325,8 @@ module.exports = function (grunt) {
sed: { sed: {
versionNumber: { versionNumber: {
pattern: (function () { pattern: (function () {
var old = grunt.option('oldver') var old = grunt.option('oldver');
return old ? RegExp.quote(old) : old return old ? RegExp.quote(old) : old;
})(), })(),
replacement: grunt.option('newver'), replacement: grunt.option('newver'),
recursive: true recursive: true
@ -364,16 +364,16 @@ module.exports = function (grunt) {
testSubtasks.push('validate-html'); testSubtasks.push('validate-html');
} }
// Only run Sauce Labs tests if there's a Sauce access key // Only run Sauce Labs tests if there's a Sauce access key
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
// Skip Sauce if running a different subset of the test suite // Skip Sauce if running a different subset of the test suite
&& (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) { (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'sauce-js-unit')) {
testSubtasks.push('connect'); testSubtasks.push('connect');
testSubtasks.push('saucelabs-qunit'); testSubtasks.push('saucelabs-qunit');
} }
// Only run BrowserStack tests if there's a BrowserStack access key // Only run BrowserStack tests if there's a BrowserStack access key
if (typeof process.env.BROWSERSTACK_KEY !== 'undefined' if (typeof process.env.BROWSERSTACK_KEY !== 'undefined' &&
// Skip BrowserStack if running a different subset of the test suite // Skip BrowserStack if running a different subset of the test suite
&& (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'browserstack-js-unit')) { (!process.env.TWBS_TEST || process.env.TWBS_TEST === 'browserstack-js-unit')) {
testSubtasks.push('browserstack_runner'); testSubtasks.push('browserstack_runner');
} }
grunt.registerTask('test', testSubtasks); grunt.registerTask('test', testSubtasks);