feather/bin/process-svgs.js

19 lines
483 B
JavaScript
Raw Normal View History

2017-11-13 19:13:11 +03:00
import fs from 'fs';
import path from 'path';
import processSvg from './process-svg';
const IN_DIR = path.resolve(__dirname, '../icons');
console.log(`Processing SVGs in ${IN_DIR}`); // eslint-disable-line no-console
2017-11-13 19:13:11 +03:00
fs
.readdirSync(IN_DIR)
2017-11-13 19:13:11 +03:00
.filter(file => path.extname(file) === '.svg')
.forEach(svgFile => {
const svg = fs.readFileSync(path.join(IN_DIR, svgFile));
processSvg(svg).then(svg =>
fs.writeFileSync(path.join(IN_DIR, svgFile), svg),
);
2017-11-13 19:13:11 +03:00
});