From 941456dde1eca763e785a17ebaffcfdfb564e09b Mon Sep 17 00:00:00 2001 From: Mathias Biilmann Christensen Date: Fri, 22 Jul 2016 17:05:18 -0700 Subject: Notify through browserSync when hugo build fails --- gulpfile.babel.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gulpfile.babel.js') diff --git a/gulpfile.babel.js b/gulpfile.babel.js index d15346f..cc568fd 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -13,8 +13,12 @@ const hugoBin = "hugo"; gulp.task("hugo", (cb) => { const args = ["-d", "../dist", "-s", "site", "-v"]; - return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", () => { - browserSync.reload(); + return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => { + if (code === 0) { + browserSync.reload(); + } else { + browserSync.notify("Hugo build failed :("); + } cb(); }); }); -- cgit v1.3