mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-20 10:15:11 -04:00
💖 spinner
This commit is contained in:
parent
780ce83c4d
commit
d59b297a8e
1 changed files with 60 additions and 48 deletions
|
@ -1,6 +1,8 @@
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
|
import { spinner } from "shared";
|
||||||
|
|
||||||
import { staticCursors, animatedCursors, animatedClip } from "../cursors.json";
|
import { staticCursors, animatedCursors, animatedClip } from "../cursors.json";
|
||||||
import { schemesPath, bitmapsPath, rawSvgsDir } from "../color";
|
import { schemesPath, bitmapsPath, rawSvgsDir } from "../color";
|
||||||
import { ColorSchema, Configs } from "../types";
|
import { ColorSchema, Configs } from "../types";
|
||||||
|
@ -15,13 +17,17 @@ const generateConfigs = (colorSchemes: ColorSchema, dirPrefix: string) => {
|
||||||
|
|
||||||
const configs: Configs = {};
|
const configs: Configs = {};
|
||||||
|
|
||||||
|
spinner.text = `Generating ${dirPrefix} Color schemes`;
|
||||||
|
spinner.start();
|
||||||
|
|
||||||
|
try {
|
||||||
for (let [schema] of Object.entries(colorSchemes)) {
|
for (let [schema] of Object.entries(colorSchemes)) {
|
||||||
const { base, outline, watch } = colorSchemes[schema];
|
|
||||||
const schemaName = `${dirPrefix}-${schema}`;
|
const schemaName = `${dirPrefix}-${schema}`;
|
||||||
|
|
||||||
const schemaSvgsPath = path.resolve(schemesPath, schemaName);
|
const schemaSvgsPath = path.resolve(schemesPath, schemaName);
|
||||||
fs.mkdirSync(schemaSvgsPath, { recursive: true });
|
fs.mkdirSync(schemaSvgsPath, { recursive: true });
|
||||||
|
|
||||||
|
const { base, outline, watch } = colorSchemes[schema];
|
||||||
staticCursors.map((cursor: string) => {
|
staticCursors.map((cursor: string) => {
|
||||||
// Read file
|
// Read file
|
||||||
let content = fs
|
let content = fs
|
||||||
|
@ -72,9 +78,15 @@ const generateConfigs = (colorSchemes: ColorSchema, dirPrefix: string) => {
|
||||||
staticCursors,
|
staticCursors,
|
||||||
animatedClip
|
animatedClip
|
||||||
};
|
};
|
||||||
|
|
||||||
|
spinner.succeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
return configs;
|
return configs;
|
||||||
|
} catch (error) {
|
||||||
|
spinner.fail();
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export { generateConfigs };
|
export { generateConfigs };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue