aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Biilmann <info@mathias-biilmann.net>2016-10-18 22:41:46 -0700
committerGitHub <noreply@github.com>2016-10-18 22:41:46 -0700
commit5ae9e9496f164e7cfdb62b69b71a671e638c7f7a (patch)
treec87b04401b9e040084fa092f92bb1f66c1ffb893
parent742a26610cefd71c35683e66d10e327260167ec5 (diff)
parent473345578f2977d6c4833bb930a4c8fb7fdae436 (diff)
Merge pull request #6 from netlify/make-sure-to-exit-with-non-zero-exit-code-on-error
Make sure to exit with non-zero exit code on hugo error
-rw-r--r--gulpfile.babel.js11
1 files changed, 8 insertions, 3 deletions
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");
+ }
});
}