diff options
| author | Mark Otto <[email protected]> | 2014-03-24 19:30:17 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2014-03-24 19:30:17 -0700 |
| commit | 39fec66fc4cb529d05f2b116abedf1bb2bdb65a8 (patch) | |
| tree | 55cdb65256a7313bfda85416a1c100c0adb62e40 /grunt | |
| parent | 4a2d337bf5f329eac1ca16208414ec1ebfe0546e (diff) | |
| parent | 6f6bce5944bd0e6ab36ab6b39339f381d8a80b2a (diff) | |
| download | bootstrap-39fec66fc4cb529d05f2b116abedf1bb2bdb65a8.tar.xz bootstrap-39fec66fc4cb529d05f2b116abedf1bb2bdb65a8.zip | |
Merge branch 'master' into fat-9461
Diffstat (limited to 'grunt')
| -rw-r--r-- | grunt/bs-glyphicons-data-generator.js | 11 | ||||
| -rw-r--r-- | grunt/bs-lessdoc-parser.js | 2 | ||||
| -rw-r--r-- | grunt/bs-raw-files-generator.js | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/grunt/bs-glyphicons-data-generator.js b/grunt/bs-glyphicons-data-generator.js index b71194367..82dc727b6 100644 --- a/grunt/bs-glyphicons-data-generator.js +++ b/grunt/bs-glyphicons-data-generator.js @@ -7,7 +7,7 @@ 'use strict'; var fs = require('fs'); -module.exports = function generateGlyphiconsData() { +module.exports = function generateGlyphiconsData(grunt) { // Pass encoding, utf8, so `readFileSync` will return a string instead of a // buffer var glyphiconsFile = fs.readFileSync('less/glyphicons.less', 'utf8'); @@ -17,6 +17,7 @@ module.exports = function generateGlyphiconsData() { var iconClassName = /^\.(glyphicon-[^\s]+)/; var glyphiconsData = '# This file is generated via Grunt task. **Do not edit directly.**\n' + '# See the \'build-glyphicons-data\' task in Gruntfile.js.\n\n'; + var glyphiconsYml = 'docs/_data/glyphicons.yml'; for (var i = 0, len = glyphiconsLines.length; i < len; i++) { var match = glyphiconsLines[i].match(iconClassName); @@ -30,5 +31,11 @@ module.exports = function generateGlyphiconsData() { fs.mkdirSync('docs/_data'); } - fs.writeFileSync('docs/_data/glyphicons.yml', glyphiconsData); + try { + fs.writeFileSync(glyphiconsYml, glyphiconsData); + } + catch (err) { + grunt.fail.warn(err); + } + grunt.log.writeln('File ' + glyphiconsYml.cyan + ' created.'); }; diff --git a/grunt/bs-lessdoc-parser.js b/grunt/bs-lessdoc-parser.js index 5a86f13a0..c1821de1c 100644 --- a/grunt/bs-lessdoc-parser.js +++ b/grunt/bs-lessdoc-parser.js @@ -22,7 +22,7 @@ Mini-language: //=== This is a subheading. //** Optional description for the following variable. You **can** use Markdown in descriptions to discuss `<html>` stuff. - @foo: #ffff; + @foo: #fff; //-- This is a heading for a section whose variables shouldn't be customizable diff --git a/grunt/bs-raw-files-generator.js b/grunt/bs-raw-files-generator.js index fd74186cc..7637da942 100644 --- a/grunt/bs-raw-files-generator.js +++ b/grunt/bs-raw-files-generator.js @@ -10,7 +10,6 @@ 'use strict'; var fs = require('fs'); var btoa = require('btoa'); -var grunt = require('grunt'); function getFiles(type) { var files = {}; @@ -25,7 +24,7 @@ function getFiles(type) { return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'; } -module.exports = function generateRawFilesJs(banner) { +module.exports = function generateRawFilesJs(grunt, banner) { if (!banner) { banner = ''; } |
