mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-06-06 01:21:32 -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");
|
const cursorDir = path.resolve(this.svgDir, "static");
|
||||||
|
|
||||||
if (!fs.existsSync(cursorDir)) {
|
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
|
const staticCursors = fs
|
||||||
|
@ -28,12 +29,8 @@ export default class SvgDirectoryParser {
|
||||||
.map((f) => path.resolve(cursorDir, f));
|
.map((f) => path.resolve(cursorDir, f));
|
||||||
|
|
||||||
if (staticCursors.length == 0) {
|
if (staticCursors.length == 0) {
|
||||||
console.warn("Static Cursors directory is empty");
|
throw new Error("🚨 Static Cursors directory is empty");
|
||||||
|
|
||||||
console.log("Considering as semi-animated theme");
|
|
||||||
this.semiAnimated = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return staticCursors;
|
return staticCursors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,10 +50,8 @@ export default class SvgDirectoryParser {
|
||||||
|
|
||||||
if (animatedCursors.length == 0 && this.semiAnimated) {
|
if (animatedCursors.length == 0 && this.semiAnimated) {
|
||||||
throw new Error(
|
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;
|
return animatedCursors;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue