feather/bin/process-svgs.js

19 lines
452 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');
2018-05-18 08:42:08 +03:00
console.log(`Processing SVGs in ${IN_DIR}...`);
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
});