Switch Font Awesome build script to use our logger

This commit is contained in:
Jérémie Astori 2017-09-17 22:19:32 -04:00
parent 82c4898715
commit aa377ee59b
No known key found for this signature in database
GPG Key ID: B9A4F245CD67BDE8

View File

@ -1,26 +1,27 @@
/* eslint-disable no-console */
"use strict"; "use strict";
var fs = require("fs-extra"); const colors = require("colors/safe");
const fs = require("fs-extra");
const log = require("../src/log");
var srcDir = "./node_modules/font-awesome/fonts/"; const srcDir = "./node_modules/font-awesome/fonts/";
var destDir = "./client/fonts/"; const destDir = "./client/fonts/";
var fonts = [ const fonts = [
"fontawesome-webfont.woff", "fontawesome-webfont.woff",
"fontawesome-webfont.woff2" "fontawesome-webfont.woff2"
]; ];
fs.ensureDir(destDir, function(dirErr) { fs.ensureDir(destDir, (dirErr) => {
if (dirErr) { if (dirErr) {
console.error(dirErr); log.error(dirErr);
} }
fonts.forEach(function(font) { fonts.forEach((font) => {
fs.copy(srcDir + font, destDir + font, function(err) { fs.copy(srcDir + font, destDir + font, (err) => {
if (err) { if (err) {
console.error(err); log.error(err);
} else { } else {
console.log(font + " successfully installed."); log.info(colors.bold(font) + " successfully installed.");
} }
}); });
}); });