pick up nolarge no matter how many spec files there are

This commit is contained in:
Luke Page 2015-08-06 19:45:24 +01:00
parent 79465895af
commit 1c817dbb9d

View file

@ -2,11 +2,13 @@ var fs = require('fs');
var PNG = require('../lib/png').PNG;
var test = require('tape');
var noLargeOption = process.argv.indexOf("nolarge") >= 0;
fs.readdir(__dirname + '/in/', function (err, files) {
if (err) throw err;
files = files.filter(function (file) {
return ((process.argv[3] || "").indexOf("nolarge") < 0 || !file.match(/large/i)) && Boolean(file.match(/\.png$/i));
return (noLargeOption || !file.match(/large/i)) && Boolean(file.match(/\.png$/i));
});
console.log("Converting images");