diff --git a/gulpfile.babel.js b/gulpfile.babel.js index b3c942c..2b62726 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -53,8 +53,13 @@ gulp.task("server", ["hugo", "css", "js"], () => { function buildSite(cb, options) { const args = options ? defaultArgs.concat(options) : defaultArgs; - return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", () => { - browserSync.reload(); - cb(); + return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => { + if (code === 0) { + browserSync.reload(); + cb(); + } else { + browserSync.notify("Hugo build failed :("); + cb("Hugo build failed"); + } }); }