Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #126 from Financial-Times/fail-build-when-build-fails
Browse files Browse the repository at this point in the history
Fail the build when the build fails
  • Loading branch information
matthew-andrews committed Jun 18, 2015
2 parents e66d70d + 6ce13d7 commit 41e9393
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function run(task, opts) {
console.log("Watching " + getGlob(task) + " and will trigger " + task);
gulp.watch(getGlob(task), [task]);
} else {
gulp.start([task], resolve);
gulp.start([task], resolve)
.on('error', reject);
}
});
}
Expand All @@ -43,11 +44,12 @@ gulp.task('build-sass', function() {
buildFolder: buildFolder,
env: isDev ? 'development' : 'production'
})
.on('end', function () {
.on('end', function() {
console.log('build-sass completed');
})
.on('error', function () {
.on('error', function(err) {
console.warn('build-sass errored');
throw err;
});
});

Expand All @@ -57,11 +59,12 @@ gulp.task('build-js', function() {
buildFolder: buildFolder,
env: 'development' // need to run as development as we do our own sourcemaps
})
.on('end', function () {
.on('end', function() {
console.log('build-js completed');
})
.on('error', function () {
.on('error', function(err) {
console.warn('build-js errored');
throw err;
});
});

Expand All @@ -71,11 +74,12 @@ gulp.task('build-minify-js', ['build-js'], function() {
.pipe(extractSourceMap({ saveTo: buildFolder + mainJsSourceMapFile }))
.pipe(minify({ sourceMapIn: buildFolder + mainJsSourceMapFile, sourceMapOut: '/' + app + '/' + mainJsSourceMapFile }))
.pipe(gulp.dest(buildFolder))
.on('end', function () {
.on('end', function() {
console.log('build-minify-js completed');
})
.on('error', function () {
.on('error', function(err) {
console.log('build-minify-js errored');
throw err;
});
});

Expand Down

0 comments on commit 41e9393

Please sign in to comment.