Skip to content

Commit

Permalink
feat: add workflow to save svg's
Browse files Browse the repository at this point in the history
  • Loading branch information
feerglas committed Sep 7, 2020
1 parent bedf09f commit e0a1ad3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions figmaExtractor/figmaWriteSvgData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const fs = require('fs');

module.exports = (iconData, config) => {

// make sure directory is there
const outputFolder = `./${config.output.folder}`;

if (!fs.existsSync(outputFolder)) {
fs.mkdirSync(outputFolder);
}

iconData.forEach((icon) => {
fs.writeFileSync(`${outputFolder}/${icon.name}.svg`, icon.svg);
});

console.log('SVG INFO: saved svg\'s');

}

0 comments on commit e0a1ad3

Please sign in to comment.