Skip to content

Commit

Permalink
Check for snippets and demos before processing (fixes #1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Aug 22, 2015
1 parent dc92764 commit 618c51f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}

Expand Down

1 comment on commit 618c51f

@addyosmani
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can make these checks more DRY, but let's try filing that upstream issue first.

Please sign in to comment.