Commit bff2288b authored by ZeHiro's avatar ZeHiro
Browse files

Add script to check the presence of logo for all the banks

parent 082ffdbf
/* eslint no-process-exit: 0 */
import * as path from 'path-extra';
import * as fs from 'fs';
import banks from '../shared/banks.json';
let log = require('printit')({
prefix: 'check-logos'
});
let imagesDir = path.join(path.dirname(fs.realpathSync(__filename)),
'..',
'static',
'images',
'banks');
let allLogoHere = true;
for (let bank of banks) {
try {
let imagePath = path.join(imagesDir, `${bank.uuid}.png`);
fs.accessSync(imagePath, fs.F_OK);
} catch (e) {
log.error(`${bank.uuid} : there is no logo for this module/bank`);
allLogoHere = false;
}
}
if (!allLogoHere) {
process.exit(1);
}
log.info('CheckLogos: OK.');
process.exit(0);
......@@ -4,6 +4,8 @@
./scripts/lint.sh ./ && \
# Compare locales
./node_modules/babel-cli/bin/babel-node.js --presets es2015 ./scripts/compare-locales.js && \
# Check all banks have a logo
./node_modules/babel-cli/bin/babel-node.js --presets es2015 ./scripts/check-logos.js && \
# Run proper tests
./node_modules/mocha/bin/mocha ./tests/ --recursive --require babel-register && \
# Add new tests here
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment