Add a build script for Font Awesome
This commit is contained in:
parent
c84cefe1d8
commit
c160ba3b84
@ -14,7 +14,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node index",
|
"start": "node index",
|
||||||
"build": "npm run build:font-awesome && npm run build:grunt && npm run build:handlebars",
|
"build": "npm run build:font-awesome && npm run build:grunt && npm run build:handlebars",
|
||||||
"build:font-awesome": "mkdir -p client/fonts && cp node_modules/font-awesome/fonts/fontawesome-webfont.* client/fonts",
|
"build:font-awesome": "node scripts/build-fontawesome.js",
|
||||||
"build:grunt": "grunt",
|
"build:grunt": "grunt",
|
||||||
"build:handlebars": "handlebars client/views/ -e tpl -f client/js/lounge.templates.js",
|
"build:handlebars": "handlebars client/views/ -e tpl -f client/js/lounge.templates.js",
|
||||||
"test": "(npm run test:mocha || true) && npm run lint",
|
"test": "(npm run test:mocha || true) && npm run lint",
|
||||||
@ -43,6 +43,7 @@
|
|||||||
"commander": "2.9.0",
|
"commander": "2.9.0",
|
||||||
"event-stream": "3.3.2",
|
"event-stream": "3.3.2",
|
||||||
"express": "4.13.4",
|
"express": "4.13.4",
|
||||||
|
"fs-extra": "0.30.0",
|
||||||
"irc-framework": "2.0.0",
|
"irc-framework": "2.0.0",
|
||||||
"lodash": "4.11.2",
|
"lodash": "4.11.2",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
|
29
scripts/build-fontawesome.js
Normal file
29
scripts/build-fontawesome.js
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
var fs = require("fs-extra");
|
||||||
|
|
||||||
|
var srcDir = "./node_modules/font-awesome/fonts/";
|
||||||
|
var destDir = "./client/fonts/";
|
||||||
|
var fonts = [
|
||||||
|
"fontawesome-webfont.eot",
|
||||||
|
"fontawesome-webfont.svg",
|
||||||
|
"fontawesome-webfont.ttf",
|
||||||
|
"fontawesome-webfont.woff",
|
||||||
|
"fontawesome-webfont.woff2"
|
||||||
|
];
|
||||||
|
|
||||||
|
fs.ensureDir(destDir, function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
fonts.forEach(function (font) {
|
||||||
|
fs.copy(srcDir + font, destDir + font, function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
} else {
|
||||||
|
console.log(font + " successfully installed.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user