mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-23 19:46:57 -04:00
✨ Spinner added
This commit is contained in:
parent
53e759f699
commit
b0611d8e78
1 changed files with 63 additions and 52 deletions
|
@ -1,4 +1,6 @@
|
|||
import fs from "fs";
|
||||
import ora from "ora";
|
||||
import chalk from "chalk";
|
||||
import path from "path";
|
||||
|
||||
import { ColorSchemes, Config, PathConfig } from "./types";
|
||||
|
@ -39,11 +41,15 @@ const generateConfigs = ({
|
|||
for (let [schema] of Object.entries(colorSchemes)) {
|
||||
const schemaName = `${themeName}-${schema}`;
|
||||
|
||||
const spinner = ora();
|
||||
spinner.text = ` Generating ${chalk.blueBright(schemaName)} Color Schema`;
|
||||
|
||||
const schemaSvgsPath = path.resolve(schemesPath, schemaName);
|
||||
fs.mkdirSync(schemaSvgsPath, { recursive: true });
|
||||
|
||||
const { base, outline, watch } = colorSchemes[schema];
|
||||
|
||||
try {
|
||||
const sCursors = staticCursors.map((cursor: string) => {
|
||||
// Read file
|
||||
let content = fs.readFileSync(cursor, "utf-8").toString();
|
||||
|
@ -108,6 +114,11 @@ const generateConfigs = ({
|
|||
animatedCursors: aCursors,
|
||||
staticCursors: sCursors
|
||||
};
|
||||
spinner.succeed();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
spinner.fail();
|
||||
}
|
||||
}
|
||||
|
||||
return configs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue