mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-06-01 23:58:30 -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) {
|
private async renderAnimatedCurs(browser: Browser, spinner: Ora) {
|
||||||
for (let [cursor] of Object.entries(this.animatedCurs)) {
|
for (let [cursor] of Object.entries(this.animatedCurs)) {
|
||||||
// Generating HTML Template
|
// Generating HTML Template
|
||||||
const { content } = this.staticCurs[cursor];
|
const { content } = this.animatedCurs[cursor];
|
||||||
const svgElement = this.getSvgElement(browser, content);
|
|
||||||
|
const svgElement = await this.getSvgElement(browser, content);
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
let index = 1;
|
let index = 1;
|
||||||
|
@ -142,7 +143,7 @@ export class BitmapsGenerator {
|
||||||
// 1st Frame
|
// 1st Frame
|
||||||
spinner.text = ` Rendering ${chalk.greenBright(firstFrame)}`;
|
spinner.text = ` Rendering ${chalk.greenBright(firstFrame)}`;
|
||||||
frames[firstFrame] = {
|
frames[firstFrame] = {
|
||||||
buffer: await (await svgElement).screenshot({
|
buffer: await svgElement.screenshot({
|
||||||
omitBackground: true,
|
omitBackground: true,
|
||||||
encoding: "binary"
|
encoding: "binary"
|
||||||
})
|
})
|
||||||
|
@ -154,7 +155,7 @@ export class BitmapsGenerator {
|
||||||
const key = getFrameName(index, cursor);
|
const key = getFrameName(index, cursor);
|
||||||
spinner.text = ` Rendering ${chalk.greenBright(key)}`;
|
spinner.text = ` Rendering ${chalk.greenBright(key)}`;
|
||||||
|
|
||||||
const newFrame = await (await svgElement).screenshot({
|
const newFrame = await svgElement.screenshot({
|
||||||
omitBackground: true,
|
omitBackground: true,
|
||||||
encoding: "binary"
|
encoding: "binary"
|
||||||
});
|
});
|
||||||
|
@ -203,6 +204,7 @@ export class BitmapsGenerator {
|
||||||
spinner.succeed();
|
spinner.succeed();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
process.exit(1);
|
||||||
spinner.fail();
|
spinner.fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue