forked from twbs/bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use different coding style for Gruntfile
Fixes twbs#12657
- Loading branch information
1 parent
9afead3
commit ba4206b
Showing
7 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"asi": false, | ||
"camelcase": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"immed": true, | ||
"indent": 2, | ||
"newcap": true, | ||
"noarg": true, | ||
"nonbsp": true, | ||
"quotmark": "single", | ||
"undef": true, | ||
"strict": true, | ||
"trailing": true, | ||
"node" : true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
/* global btoa: true */ | ||
|
||
/*! | ||
* Bootstrap Grunt task for generating raw-files.min.js for the Customizer | ||
* http://getbootstrap.com | ||
* Copyright 2014 Twitter, Inc. | ||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | ||
*/ | ||
|
||
var btoa = require('btoa') | ||
var fs = require('fs') | ||
'use strict'; | ||
var btoa = require('btoa'); | ||
var fs = require('fs'); | ||
|
||
function getFiles(type) { | ||
var files = {} | ||
var files = {}; | ||
fs.readdirSync(type) | ||
.filter(function (path) { | ||
return type == 'fonts' ? true : new RegExp('\\.' + type + '$').test(path) | ||
return type === 'fonts' ? true : new RegExp('\\.' + type + '$').test(path); | ||
}) | ||
.forEach(function (path) { | ||
var fullPath = type + '/' + path | ||
return files[path] = (type == 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8')) | ||
}) | ||
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n' | ||
var fullPath = type + '/' + path; | ||
files[path] = (type === 'fonts' ? btoa(fs.readFileSync(fullPath)) : fs.readFileSync(fullPath, 'utf8')); | ||
}); | ||
return 'var __' + type + ' = ' + JSON.stringify(files) + '\n'; | ||
} | ||
|
||
module.exports = function generateRawFilesJs(banner) { | ||
if (!banner) { | ||
banner = '' | ||
banner = ''; | ||
} | ||
var files = banner + getFiles('js') + getFiles('less') + getFiles('fonts') | ||
fs.writeFileSync('docs/assets/js/raw-files.min.js', files) | ||
} | ||
var files = banner + getFiles('js') + getFiles('less') + getFiles('fonts'); | ||
fs.writeFileSync('docs/assets/js/raw-files.min.js', files); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters