Guest User

Untitled

a guest
May 8th, 2021
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { readdirSync } = require('fs');
  2.  
  3. const getDirectories = source =>
  4. readdirSync(source, { withFileTypes: true })
  5. .filter(dirent => dirent.isDirectory())
  6. .map(dirent => dirent.name);
  7.  
  8. const dirs = getDirectories(__dirname);
  9.  
  10. for (const dir of dirs) {
  11. fs.renameSync(`${dir}/SVG/${dir}_regular.png`, `${dir}/icon_regular.png`);
  12. fs.renameSync(`${dir}/SVG/${dir}_filled.png`, `${dir}/icon_filled.png`);
  13. fs.rmdirSync(`${dir}/SVG`);
  14. }
  15.  
  16.  
RAW Paste Data