2016-06-04 20:55:21 +00:00
|
|
|
"use strict";
|
|
|
|
|
2017-09-18 02:19:32 +00:00
|
|
|
const colors = require("colors/safe");
|
|
|
|
const fs = require("fs-extra");
|
|
|
|
const log = require("../src/log");
|
2016-06-04 20:55:21 +00:00
|
|
|
|
2017-09-18 02:19:32 +00:00
|
|
|
const srcDir = "./node_modules/font-awesome/fonts/";
|
|
|
|
const destDir = "./client/fonts/";
|
|
|
|
const fonts = [
|
2016-06-04 20:55:21 +00:00
|
|
|
"fontawesome-webfont.woff",
|
|
|
|
"fontawesome-webfont.woff2"
|
|
|
|
];
|
|
|
|
|
2017-09-18 02:19:32 +00:00
|
|
|
fs.ensureDir(destDir, (dirErr) => {
|
2016-10-09 08:54:44 +00:00
|
|
|
if (dirErr) {
|
2017-09-18 02:19:32 +00:00
|
|
|
log.error(dirErr);
|
2016-06-04 20:55:21 +00:00
|
|
|
}
|
|
|
|
|
2017-09-18 02:19:32 +00:00
|
|
|
fonts.forEach((font) => {
|
|
|
|
fs.copy(srcDir + font, destDir + font, (err) => {
|
2016-06-04 20:55:21 +00:00
|
|
|
if (err) {
|
2017-09-18 02:19:32 +00:00
|
|
|
log.error(err);
|
2016-06-04 20:55:21 +00:00
|
|
|
} else {
|
2017-09-18 02:19:32 +00:00
|
|
|
log.info(colors.bold(font) + " successfully installed.");
|
2016-06-04 20:55:21 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|