Skip to content

Commit 64adc64

Browse files
author
Franco Moya
committedMar 17, 2017
Fix error handling and notifications
1 parent 85722c8 commit 64adc64

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed
 

‎gulpfile.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ gulp.task('bs-reload', () => {
5757

5858
// Compile Sass in development environment with Sourcemaps
5959
gulp.task('sass', () => {
60-
let onError = (err) => {
60+
function onError(err) {
6161
$.notify.onError({
62-
title: 'Gulp Sass',
62+
title: 'Groundwork Lite',
6363
subtitle: 'Ups! Sass build failed 😱',
6464
message: 'Error: <%= error.message %>'
6565
})(err);
66+
this.emit('end');
6667
};
6768

6869
return gulp.src(paths.scss.src)
@@ -75,8 +76,9 @@ gulp.task('sass', () => {
7576
.pipe(browserSync.stream())
7677
.pipe($.plumber.stop())
7778
.pipe($.notify({
78-
title: 'Gulp Sass',
79-
subtitle: '👌 Yeah! Sass compiled without problems~',
79+
title: 'Groundwork Lite',
80+
message: 'Yeah! Sass compiled without problems 👌',
81+
onLast: true
8082
}))
8183
});
8284

@@ -93,12 +95,13 @@ gulp.task('copy', () => {
9395

9496
// Stylesheets for production environment with minified version
9597
gulp.task('styles', () => {
96-
let onError = (err) => {
98+
function onError(err) {
9799
$.notify.onError({
98-
title: 'Gulp Sass',
100+
title: 'Groundwork Lite',
99101
subtitle: 'Ups! Sass build failed 😱',
100102
message: 'Error: <%= error.message %>'
101103
})(err);
104+
this.emit('end');
102105
};
103106

104107
return gulp.src(paths.scss.src)
@@ -116,7 +119,8 @@ gulp.task('styles', () => {
116119
.pipe($.plumber.stop())
117120
.pipe($.notify({
118121
title: 'Gulp Styles',
119-
subtitle: '👌 Yeah! Stylesheets created without problems~',
122+
message: 'Yeah! Stylesheets created without problems 👌',
123+
onLast: true
120124
}))
121125
});
122126

@@ -125,6 +129,6 @@ gulp.task('build', ['clean', 'copy', 'styles']);
125129

126130
// Watch sass files for changes
127131
gulp.task('default', ['browser-sync'], () => {
128-
gulp.watch('src/**/*.scss', ['sass']);
129-
gulp.watch('src/*.html', ['bs-reload']);
132+
gulp.watch(base.src + '**/*.scss', ['sass']);
133+
gulp.watch(base.src + '*.html', ['bs-reload']);
130134
});

0 commit comments

Comments
 (0)
Please sign in to comment.