🔧 Source .svg from json data

This commit is contained in:
KaizIqbal 2020-07-25 18:16:10 +05:30
parent 0651684559
commit bb35cdaa83

View file

@ -1,18 +1,13 @@
import path from "path"; import path from "path";
import fs from "fs"; import { cursors } from "./cursors.json";
// Source Directory // Source Directory
const svgsDir = path.resolve(__dirname, "svg"); const svgsDir = path.resolve(__dirname, "svg");
// .svg // Resolve Paths for svg
let svgs = fs const svgs = cursors.map((svg: string) => path.resolve(svgsDir, svg));
.readdirSync(svgsDir)
.filter((file) => path.extname(file) === ".svg");
svgs = svgs.map((svg: string) => path.resolve(svgsDir, svg));
const animatedCursor = ["watch", "left_ptr_watch"];
// Out Directory // Out Directory
const bitmapsDir = path.resolve(process.cwd(), "bitmaps"); const bitmapsDir = path.resolve(process.cwd(), "bitmaps");
export { svgs, animatedCursor, bitmapsDir }; export { svgs, bitmapsDir };