1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-24 01:10:11 +00:00

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

View File

@ -93,13 +93,17 @@ function genThemes( title, src, fmt ) {
}
function folderContains( needle, haystack ) {
var ignoreExts = ['.png','.jpg','.jpeg','.bmp','.pdf', '.gif'];
var safePath = path.normalize( path.join(__dirname, haystack));
return _.some( readFolder( safePath ), function( absPath ) {
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);
return true;
}
return false;
}
});
}