diff options
| author | Mathias Biilmann Christensen <info@mathias-biilmann.net> | 2016-07-22 17:05:18 -0700 |
|---|---|---|
| committer | Mathias Biilmann Christensen <info@mathias-biilmann.net> | 2016-07-22 17:05:18 -0700 |
| commit | 941456dde1eca763e785a17ebaffcfdfb564e09b (patch) | |
| tree | aee7d7e9f21f453606afdb5d59544079fdd502b8 | |
| parent | c8fc39df18bb1c12c86b631044c8b30983a6a895 (diff) | |
Notify through browserSync when hugo build fails
| -rw-r--r-- | gulpfile.babel.js | 8 |
1 files changed, 6 insertions, 2 deletions
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(); }); }); |
