aboutsummaryrefslogtreecommitdiff
path: root/grunt
diff options
context:
space:
mode:
Diffstat (limited to 'grunt')
-rw-r--r--grunt/bs-glyphicons-data-generator.js11
-rw-r--r--grunt/bs-lessdoc-parser.js2
-rw-r--r--grunt/bs-raw-files-generator.js3
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 = '';
}