mirror of
https://github.com/ful1e5/apple_cursor.git
synced 2025-05-14 15:15:02 -04:00
🎨 Code refactor
This commit is contained in:
parent
57c424e668
commit
0771cf6777
1 changed files with 13 additions and 11 deletions
24
src/index.ts
24
src/index.ts
|
@ -1,19 +1,21 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
|
|
||||||
import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
import { generateRenderTemplate } from "./helpers/htmlTemplate";
|
||||||
import { svgs } from "./config";
|
import { staticSvgs } from "./config";
|
||||||
|
|
||||||
|
const generateStaticSvgBitmaps = (svg: string) => {
|
||||||
|
fs.readFile(svg, "utf8", (error, data) => {
|
||||||
|
if (error) {
|
||||||
|
return console.log(error);
|
||||||
|
}
|
||||||
|
// Generating HTML Template
|
||||||
|
generateRenderTemplate(data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// iterate over all .svg files
|
// iterate over all .svg files
|
||||||
svgs.forEach((svg) => {
|
staticSvgs.forEach((svg) => {
|
||||||
// reading file
|
generateStaticSvgBitmaps(svg);
|
||||||
fs.readFile(svg, "utf8", (error, data) => {
|
|
||||||
if (error) {
|
|
||||||
return console.log(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Generating HTML Template
|
|
||||||
generateRenderTemplate(data);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue