diff --git a/Gruntfile.js b/Gruntfile.js index cc3d36dc6c..d3ae934af1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -254,21 +254,6 @@ var config = require('./core/server/config'), } }, - // ### grunt-docker - // Generate documentation from code - docker: { - docs: { - dest: 'docs', - src: ['.'], - options: { - onlyUpdated: true, - exclude: 'node_modules,bower_components,content,core/client,*test,*doc*,' + - '*vendor,config.*.json,*buil*,.dist*,.idea,.git*,.travis.yml,.bower*,.editorconfig,.js*,*.md,' + - 'MigratorConfig.js' - } - } - }, - // ### grunt-contrib-clean // Clean up files as part of other tasks clean: { diff --git a/content/themes/casper/gulpfile.js b/content/themes/casper/gulpfile.js index 831e70f613..779a588566 100644 --- a/content/themes/casper/gulpfile.js +++ b/content/themes/casper/gulpfile.js @@ -1,13 +1,14 @@ var gulp = require('gulp'); +var pump = require('pump'); // gulp plugins and utils -var gutil = require('gulp-util'); var livereload = require('gulp-livereload'); var postcss = require('gulp-postcss'); var sourcemaps = require('gulp-sourcemaps'); var zip = require('gulp-zip'); var uglify = require('gulp-uglify'); var filter = require('gulp-filter'); +var beeper = require('beeper'); // postcss plugins var autoprefixer = require('autoprefixer'); @@ -16,23 +17,26 @@ var cssnano = require('cssnano'); var customProperties = require('postcss-custom-properties'); var easyimport = require('postcss-easy-import'); -var swallowError = function swallowError(error) { - gutil.log(error.toString()); - gutil.beep(); - this.emit('end'); -}; - var nodemonServerInit = function () { livereload.listen(1234); }; +function handleError(done) { + return function (err) { + if (err) { + beeper(); + } + return done(err); + }; +} + gulp.task('build', ['css', 'js'], function (/* cb */) { return nodemonServerInit(); }); gulp.task('generate', ['css', 'js']); -gulp.task('css', function () { +gulp.task('css', function (done) { var processors = [ easyimport, customProperties, @@ -41,45 +45,49 @@ gulp.task('css', function () { cssnano() ]; - return gulp.src('assets/css/*.css') - .on('error', swallowError) - .pipe(sourcemaps.init()) - .pipe(postcss(processors)) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('assets/built/')) - .pipe(livereload()); + pump([ + gulp.src('assets/css/*.css'), + sourcemaps.init(), + postcss(processors), + sourcemaps.write('.'), + gulp.dest('assets/built/'), + livereload() + ], handleError(done)); }); -gulp.task('js', function () { +gulp.task('js', function (done) { var jsFilter = filter(['**/*.js'], {restore: true}); - return gulp.src('assets/js/*.js') - .on('error', swallowError) - .pipe(sourcemaps.init()) - .pipe(jsFilter) - .pipe(uglify()) - .pipe(jsFilter.restore) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('assets/built/')) - .pipe(livereload()); + pump([ + gulp.src('assets/js/*.js'), + sourcemaps.init(), + jsFilter, + uglify(), + jsFilter.restore, + sourcemaps.write('.'), + gulp.dest('assets/built/'), + livereload() + ], handleError(done)); }); gulp.task('watch', function () { gulp.watch('assets/css/**', ['css']); }); -gulp.task('zip', ['css', 'js'], function () { +gulp.task('zip', ['css', 'js'], function (done) { var targetDir = 'dist/'; var themeName = require('./package.json').name; var filename = themeName + '.zip'; - return gulp.src([ - '**', - '!node_modules', '!node_modules/**', - '!dist', '!dist/**' - ]) - .pipe(zip(filename)) - .pipe(gulp.dest(targetDir)); + pump([ + gulp.src([ + '**', + '!node_modules', '!node_modules/**', + '!dist', '!dist/**' + ]), + zip(filename), + gulp.dest(targetDir) + ], handleError(done)); }); gulp.task('default', ['build'], function () { diff --git a/content/themes/casper/index.hbs b/content/themes/casper/index.hbs index fb0bdbb230..1b27417d00 100644 --- a/content/themes/casper/index.hbs +++ b/content/themes/casper/index.hbs @@ -7,7 +7,7 @@ into the {body} of the default.hbs template --}}