mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-17 08:35:03 -04:00
⏸ Await method
This commit is contained in:
parent
4c1e73308c
commit
cce5a2ed84
1 changed files with 7 additions and 8 deletions
15
src/index.ts
15
src/index.ts
|
@ -5,7 +5,7 @@ import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
|||
// import { renderSvg } from "./helpers/render";
|
||||
import { staticSvgs, bitmapsDir } from "./config";
|
||||
|
||||
const generateStaticSvgBitmaps = (svg: string) => {
|
||||
const generateStaticSvgBitmaps = async (svg: string) => {
|
||||
fs.readFile(svg, "utf8", (error, data) => {
|
||||
if (error) {
|
||||
return console.log(error);
|
||||
|
@ -14,16 +14,15 @@ const generateStaticSvgBitmaps = (svg: string) => {
|
|||
// Generating HTML Template
|
||||
generateRenderTemplate(data);
|
||||
|
||||
// rendering svg
|
||||
// preparing paths
|
||||
let bitmap = path.parse(svg).base;
|
||||
bitmap = path.resolve(bitmapsDir, bitmap);
|
||||
|
||||
console.log(bitmap);
|
||||
});
|
||||
};
|
||||
|
||||
(async () => {
|
||||
// iterate over all .svg files
|
||||
staticSvgs.forEach((svg) => {
|
||||
generateStaticSvgBitmaps(svg);
|
||||
});
|
||||
})();
|
||||
// iterate over satic .svg files
|
||||
staticSvgs.forEach(async (svg) => {
|
||||
await generateStaticSvgBitmaps(svg);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue