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
This commit is contained in:
commit
5ae9e9496f
|
@ -53,8 +53,13 @@ gulp.task("server", ["hugo", "css", "js"], () => {
|
||||||
function buildSite(cb, options) {
|
function buildSite(cb, options) {
|
||||||
const args = options ? defaultArgs.concat(options) : defaultArgs;
|
const args = options ? defaultArgs.concat(options) : defaultArgs;
|
||||||
|
|
||||||
return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", () => {
|
return cp.spawn(hugoBin, args, {stdio: "inherit"}).on("close", (code) => {
|
||||||
|
if (code === 0) {
|
||||||
browserSync.reload();
|
browserSync.reload();
|
||||||
cb();
|
cb();
|
||||||
|
} else {
|
||||||
|
browserSync.notify("Hugo build failed :(");
|
||||||
|
cb("Hugo build failed");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue