Commit bf1fc7e6 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[BUGFIX] check presence of sprite folder before starting sprity

parent 8c463eca
......@@ -47,17 +47,20 @@ gulp.task('css', ['sprites', 'svg'], function() {
// create spritesheet
gulp.task('sprites', function() {
return sprity.src({
src: settings.path().sprites + '/**/*.png',
name: 'sprites',
style: '_sprite.scss',
cssPath: path.relative(path.resolve(settings.path().css), path.resolve(settings.path().images)) + '/',
template: 'gulp/sprite-scss-template.mustache',
orientation: 'binary-tree',
cachebuster: true
})
.pipe(imagemin())
.pipe(gulpif('*.png', gulp.dest(settings.path().images), gulp.dest(settings.path().sass)));
// necessary right now because of https://github.com/sprity/sprity/issues/23
if (fs.existsSync(settings.path().sprites)) {
return sprity.src({
src: settings.path().sprites + '/**/*.png',
name: 'sprites',
style: '_sprite.scss',
cssPath: path.relative(path.resolve(settings.path().css), path.resolve(settings.path().images)) + '/',
template: 'gulp/sprite-scss-template.mustache',
orientation: 'binary-tree',
cachebuster: true
})
.pipe(imagemin())
.pipe(gulpif('*.png', gulp.dest(settings.path().images), gulp.dest(settings.path().sass)));
}
});
gulp.task('svg', function() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment