From 618c51fbfa1989d4e99114fe4c78d9d20b707cef Mon Sep 17 00:00:00 2001 From: Surma Date: Sat, 22 Aug 2015 14:16:23 +0100 Subject: [PATCH] Check for snippets and demos before processing (fixes #1447) --- gulpfile.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index b32c0e993..e639dff23 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -367,6 +367,17 @@ gulp.task('demos', ['demoresources'], function() { return fs.readdirSync('./src/') .filter(function(file) { return fs.statSync(path.join('./src/', file)).isDirectory(); + }) + .filter(function(file) { + var demoFile = false; + var snippetDir = false; + try { + demoFile = fs.statSync(path.join('./src/', file, 'demo.html')).isFile(); + } catch (e) {} + try { + snippetDir = fs.statSync(path.join('./src/', file, 'snippets')).isDirectory(); + } catch (e) {} + return demoFile || snippetDir; }); }