Skip to content

Commit

Permalink
only 55 iconset in package
Browse files Browse the repository at this point in the history
  • Loading branch information
andronasef committed Oct 14, 2022
1 parent cd0ed90 commit 9535690
Show file tree
Hide file tree
Showing 5 changed files with 360 additions and 201 deletions.
19 changes: 19 additions & 0 deletions generator/export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// list all files in a directory in Node.js recursively in a synchronous fashion

import fs from 'fs';
import path from 'path';

// list files in directory
function listFiles(dir, fileList = []) {
const files = fs.readdirSync(dir);

files.forEach((file) => {
fileList.push(path.join(file));
});

return fileList;
}
fs.writeFileSync('lib/icons.dart', '');
for (const file of listFiles('lib/icons')) {
fs.appendFileSync('lib/icons.dart', `export 'icons/${file}';\n`);
}
Loading

0 comments on commit 9535690

Please sign in to comment.