mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-20 02:05:12 -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 path from "path";
|
||||
|
||||
import { spinner } from "shared";
|
||||
|
||||
import { staticCursors, animatedCursors, animatedClip } from "../cursors.json";
|
||||
import { schemesPath, bitmapsPath, rawSvgsDir } from "../color";
|
||||
import { ColorSchema, Configs } from "../types";
|
||||
|
@ -15,13 +17,17 @@ const generateConfigs = (colorSchemes: ColorSchema, dirPrefix: string) => {
|
|||
|
||||
const configs: Configs = {};
|
||||
|
||||
spinner.text = `Generating ${dirPrefix} Color schemes`;
|
||||
spinner.start();
|
||||
|
||||
try {
|
||||
for (let [schema] of Object.entries(colorSchemes)) {
|
||||
const { base, outline, watch } = colorSchemes[schema];
|
||||
const schemaName = `${dirPrefix}-${schema}`;
|
||||
|
||||
const schemaSvgsPath = path.resolve(schemesPath, schemaName);
|
||||
fs.mkdirSync(schemaSvgsPath, { recursive: true });
|
||||
|
||||
const { base, outline, watch } = colorSchemes[schema];
|
||||
staticCursors.map((cursor: string) => {
|
||||
// Read file
|
||||
let content = fs
|
||||
|
@ -72,9 +78,15 @@ const generateConfigs = (colorSchemes: ColorSchema, dirPrefix: string) => {
|
|||
staticCursors,
|
||||
animatedClip
|
||||
};
|
||||
|
||||
spinner.succeed();
|
||||
}
|
||||
|
||||
return configs;
|
||||
} catch (error) {
|
||||
spinner.fail();
|
||||
process.exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
export { generateConfigs };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue