mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-30 23:05:24 -04:00
🚨 Throw Empty svg directory exception
This commit is contained in:
parent
9720ce684f
commit
a704439599
1 changed files with 4 additions and 9 deletions
|
@ -20,7 +20,8 @@ export default class SvgDirectoryParser {
|
|||
const cursorDir = path.resolve(this.svgDir, "static");
|
||||
|
||||
if (!fs.existsSync(cursorDir)) {
|
||||
throw new Error("🚨 Static Cursors directory not found");
|
||||
console.log("Considering as semi-animated theme");
|
||||
this.semiAnimated = true;
|
||||
}
|
||||
|
||||
const staticCursors = fs
|
||||
|
@ -28,12 +29,8 @@ export default class SvgDirectoryParser {
|
|||
.map((f) => path.resolve(cursorDir, f));
|
||||
|
||||
if (staticCursors.length == 0) {
|
||||
console.warn("Static Cursors directory is empty");
|
||||
|
||||
console.log("Considering as semi-animated theme");
|
||||
this.semiAnimated = true;
|
||||
throw new Error("🚨 Static Cursors directory is empty");
|
||||
}
|
||||
|
||||
return staticCursors;
|
||||
}
|
||||
|
||||
|
@ -53,10 +50,8 @@ export default class SvgDirectoryParser {
|
|||
|
||||
if (animatedCursors.length == 0 && this.semiAnimated) {
|
||||
throw new Error(
|
||||
`🚨 Can't parse svg directory ${this.svgDir} as semi-animated cursors`
|
||||
`🚨 Can't parse svg directory ${this.svgDir} as semi-animated theme`
|
||||
);
|
||||
} else {
|
||||
console.warn("Animated Cursors directory is empty");
|
||||
}
|
||||
|
||||
return animatedCursors;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue