mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-19 17:55:11 -04:00
📁 Out Directory naming
This commit is contained in:
parent
2a52a2334b
commit
2d7e84af09
1 changed files with 8 additions and 9 deletions
|
@ -3,15 +3,18 @@ import path from "path";
|
|||
import rimraf from "rimraf";
|
||||
|
||||
import { staticCursors, animatedCursors, animatedClip } from "../cursors.json";
|
||||
import { rawSvgsDir } from "../config";
|
||||
import { ColorSchemas } from "../types";
|
||||
import { ColorSchema } from "../types";
|
||||
|
||||
const generateConfigs = (colorSchemes: ColorSchemas) => {
|
||||
const generateConfigs = (
|
||||
colorSchemes: ColorSchema,
|
||||
dirPrefix: string,
|
||||
rawSvgsDir: string
|
||||
) => {
|
||||
const configs: any = [];
|
||||
|
||||
for (let [schema] of Object.entries(colorSchemes)) {
|
||||
const { base, outline } = colorSchemes[schema];
|
||||
const schemaName = `Bibata_${schema}`;
|
||||
const schemaName = `${dirPrefix} ${schema}`;
|
||||
|
||||
const schemaSvgsPath = path.resolve("./src/svg", schemaName);
|
||||
|
||||
|
@ -32,11 +35,7 @@ const generateConfigs = (colorSchemes: ColorSchemas) => {
|
|||
.readFileSync(path.resolve(rawSvgsDir, svgFile), "utf-8")
|
||||
.toString();
|
||||
|
||||
content = content
|
||||
.replace("black", base)
|
||||
.replace("white", outline)
|
||||
.replace("#000000", base)
|
||||
.replace("#ffffff", outline);
|
||||
content = content.replace("#00FF00", base).replace("#0000FF", outline);
|
||||
|
||||
// Writing new svg
|
||||
fs.writeFileSync(filePath, content, "utf-8");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue