mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-30 06:45:31 -04:00
🚨 Error handling added
This commit is contained in:
parent
d895fe8065
commit
c380a50a7c
1 changed files with 6 additions and 4 deletions
|
@ -130,8 +130,9 @@ export class BitmapsGenerator {
|
|||
private async renderAnimatedCurs(browser: Browser, spinner: Ora) {
|
||||
for (let [cursor] of Object.entries(this.animatedCurs)) {
|
||||
// Generating HTML Template
|
||||
const { content } = this.staticCurs[cursor];
|
||||
const svgElement = this.getSvgElement(browser, content);
|
||||
const { content } = this.animatedCurs[cursor];
|
||||
|
||||
const svgElement = await this.getSvgElement(browser, content);
|
||||
|
||||
// Config
|
||||
let index = 1;
|
||||
|
@ -142,7 +143,7 @@ export class BitmapsGenerator {
|
|||
// 1st Frame
|
||||
spinner.text = ` Rendering ${chalk.greenBright(firstFrame)}`;
|
||||
frames[firstFrame] = {
|
||||
buffer: await (await svgElement).screenshot({
|
||||
buffer: await svgElement.screenshot({
|
||||
omitBackground: true,
|
||||
encoding: "binary"
|
||||
})
|
||||
|
@ -154,7 +155,7 @@ export class BitmapsGenerator {
|
|||
const key = getFrameName(index, cursor);
|
||||
spinner.text = ` Rendering ${chalk.greenBright(key)}`;
|
||||
|
||||
const newFrame = await (await svgElement).screenshot({
|
||||
const newFrame = await svgElement.screenshot({
|
||||
omitBackground: true,
|
||||
encoding: "binary"
|
||||
});
|
||||
|
@ -203,6 +204,7 @@ export class BitmapsGenerator {
|
|||
spinner.succeed();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
spinner.fail();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue