|
|
@ -9,19 +9,21 @@ var
|
|
|
|
json = require(process.env.WAPPALYZER_ROOT + '/src/apps.json');
|
|
|
|
json = require(process.env.WAPPALYZER_ROOT + '/src/apps.json');
|
|
|
|
|
|
|
|
|
|
|
|
for ( app in json.apps ) {
|
|
|
|
for ( app in json.apps ) {
|
|
|
|
var path = process.env.WAPPALYZER_ROOT + '/src/icons/' + app + '.png';
|
|
|
|
(function(app) {
|
|
|
|
|
|
|
|
var path = process.env.WAPPALYZER_ROOT + '/src/icons/' + app + '.png';
|
|
|
|
|
|
|
|
|
|
|
|
fs.exists(path, function(exists) {
|
|
|
|
fs.exists(path, function(exists) {
|
|
|
|
var buffer;
|
|
|
|
var buffer;
|
|
|
|
|
|
|
|
|
|
|
|
if ( exists ) {
|
|
|
|
if ( exists ) {
|
|
|
|
buffer = fileType(readChunk.sync(path, 0, 262));
|
|
|
|
buffer = fileType(readChunk.sync(path, 0, 262));
|
|
|
|
|
|
|
|
|
|
|
|
if ( buffer.mime !== 'image/png' ) {
|
|
|
|
if ( buffer.mime !== 'image/png' ) {
|
|
|
|
throw new Error('Incorrect mimetype "' + buffer.mime + '": src/icons/' + app + '.png');
|
|
|
|
throw new Error('Incorrect mimetype "' + buffer.mime + '": src/icons/' + app + '.png');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw new Error('Missing file: src/icons/' + app + '.png');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
});
|
|
|
|
throw new Error('Missing file: src/icons/' + app + '.png');
|
|
|
|
}(app));
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|