test: remove image files from freeze test

This commit is contained in:
hacksalot 2018-02-05 00:06:14 -05:00
parent dc88073bcc
commit 6f07141b0d
No known key found for this signature in database
GPG Key ID: 2F343EC247CA4B06
1 changed files with 5 additions and 1 deletions

View File

@ -93,13 +93,17 @@ function genThemes( title, src, fmt ) {
} }
function folderContains( needle, haystack ) { function folderContains( needle, haystack ) {
var ignoreExts = ['.png','.jpg','.jpeg','.bmp','.pdf', '.gif'];
var safePath = path.normalize( path.join(__dirname, haystack)); var safePath = path.normalize( path.join(__dirname, haystack));
return _.some( readFolder( safePath ), function( absPath ) { return _.some( readFolder( safePath ), function( absPath ) {
if( require('fs').lstatSync( absPath ).isFile() ) { if( require('fs').lstatSync( absPath ).isFile() ) {
if( fileContains( absPath, needle ) ) { var pathInfo = path.parse( absPath );
if( !_.contains(ignoreExts, pathInfo.ext) &&
fileContains(absPath, needle) ) {
console.error('Found invalid metadata in ' + absPath); console.error('Found invalid metadata in ' + absPath);
return true; return true;
} }
return false;
} }
}); });
} }