Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
d1c29af5
Commit
d1c29af5
authored
11 years ago
by
Chris Rebert
Browse files
Options
Download
Email Patches
Plain Diff
extract raw-files.js generator out of Gruntfile into separate module
parent
b67fc690
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Gruntfile.js
+2
-18
Gruntfile.js
docs/grunt/bs-raw-files-generator.js
+22
-0
docs/grunt/bs-raw-files-generator.js
with
24 additions
and
18 deletions
+24
-18
Gruntfile.js
+
2
-
18
View file @
d1c29af5
...
@@ -11,7 +11,7 @@ module.exports = function (grunt) {
...
@@ -11,7 +11,7 @@ module.exports = function (grunt) {
}
}
var
fs
=
require
(
'
fs
'
)
var
fs
=
require
(
'
fs
'
)
var
btoa
=
require
(
'
btoa
'
)
var
generateRawFilesJs
=
require
(
'
./docs/grunt/bs-raw-files-generator.js
'
)
// Project configuration.
// Project configuration.
grunt
.
initConfig
({
grunt
.
initConfig
({
...
@@ -360,21 +360,5 @@ module.exports = function (grunt) {
...
@@ -360,21 +360,5 @@ module.exports = function (grunt) {
});
});
// task for building customizer
// task for building customizer
grunt
.
registerTask
(
'
build-customizer
'
,
'
Add scripts/less files to customizer.
'
,
function
()
{
grunt
.
registerTask
(
'
build-customizer
'
,
'
Add scripts/less files to customizer.
'
,
generateRawFilesJs
);
function
getFiles
(
type
)
{
var
files
=
{}
fs
.
readdirSync
(
type
)
.
filter
(
function
(
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
files
=
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
getFiles
(
'
fonts
'
)
fs
.
writeFileSync
(
'
docs/assets/js/raw-files.js
'
,
files
)
});
};
};
This diff is collapsed.
Click to expand it.
docs/grunt/bs-raw-files-generator.js
0 → 100644
+
22
-
0
View file @
d1c29af5
/* jshint node: true */
var
btoa
=
require
(
'
btoa
'
)
var
fs
=
require
(
'
fs
'
)
function
getFiles
(
type
)
{
var
files
=
{}
fs
.
readdirSync
(
type
)
.
filter
(
function
(
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
'
}
module
.
exports
=
function
generateRawFilesJs
()
{
var
files
=
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
getFiles
(
'
fonts
'
)
fs
.
writeFileSync
(
'
docs/assets/js/raw-files.js
'
,
files
)
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets