From 0544b37ba3d4c40837b163ac4e9beeff93ba52d2 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Wed, 18 Jul 2018 07:38:29 +0100 Subject: [PATCH] update dev scripts --- scripts/dev.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/scripts/dev.js b/scripts/dev.js index e18062e..0358e65 100644 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -7,21 +7,22 @@ const cssPath = path.join(__dirname, '../src/css') const jsPath = path.join(__dirname, '../src/js') const http = require('http') +const options = { + stdout: process.stdout, + stderr: process.stderr +} + const runHugo = () => { - console.log('Rebuilding...') - return runAll(['build:hugo'], { - stdout: process.stdout, - stderr: process.stderr - }).then(() => console.log('Done!')).catch(console.log) + return runAll(['build:hugo'], options).catch(() => {}) } const handler = (path) => { if (path.startsWith(dataFolder)) { - runAll(['build:data'], {parallel: false}).then(runHugo) + runAll(['build:data'], options).then(runHugo) } else if (path.startsWith(cssPath)) { - runAll(['build:css'], {parallel: false}).then(runHugo) + runAll(['build:css'], options).then(runHugo) } else if (path.startsWith(jsPath)) { - runAll(['build:js'], {parallel: false}).then(runHugo) + runAll(['build:js'], options).then(runHugo) } else { runHugo() } @@ -29,8 +30,12 @@ const handler = (path) => { async function run () { console.log('Preparing fonts, css, js and data...') - await runAll(['build:fonts', 'build:css', 'build:js', 'build:css', 'build:data'], {parallel: true}) - console.log('Running Hugo once...') + await runAll(['build:fonts', 'build:css', 'build:js', 'build:icons', 'build:data'], { + stdout: process.stdout, + stderr: process.stderr, + parallel: true + }) + await runHugo() console.log('Starting server...')