Notify through browserSync when hugo build fails

This commit is contained in:
Mathias Biilmann Christensen 2016-07-22 17:05:18 -07:00
parent c8fc39df18
commit 941456dde1
1 changed files with 6 additions and 2 deletions

View File

@ -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", () => {
return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => {
if (code === 0) {
browserSync.reload();
} else {
browserSync.notify("Hugo build failed :(");
}
cb();
});
});