Notify through browserSync when hugo build fails
This commit is contained in:
parent
c8fc39df18
commit
941456dde1
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Reference in New Issue