forked from andronasef/iconify_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd0ed90
commit 9535690
Showing
5 changed files
with
360 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`); | ||
} |
Oops, something went wrong.