From 9f08ae3ff5672ea29f90bb2473a34263c9c8fdfa Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Thu, 12 Nov 2020 17:05:58 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=96=20semi-animated=20directory=20logs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/src/SvgHandler/SvgDirectoryParser.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/core/src/SvgHandler/SvgDirectoryParser.ts b/packages/core/src/SvgHandler/SvgDirectoryParser.ts index be075fd8..6c2c7b48 100644 --- a/packages/core/src/SvgHandler/SvgDirectoryParser.ts +++ b/packages/core/src/SvgHandler/SvgDirectoryParser.ts @@ -20,18 +20,19 @@ export default class SvgDirectoryParser { const cursorDir = path.resolve(this.svgDir, "static"); if (!fs.existsSync(cursorDir)) { - console.log("Considering as semi-animated theme"); + console.log(`Considering ${cursorDir} as semi-animated theme`); this.semiAnimated = true; - } + return []; + } else { + const staticCursors = fs + .readdirSync(cursorDir) + .map((f) => path.resolve(cursorDir, f)); - const staticCursors = fs - .readdirSync(cursorDir) - .map((f) => path.resolve(cursorDir, f)); - - if (staticCursors.length == 0) { - throw new Error("🚨 Static Cursors directory is empty"); + if (staticCursors.length == 0) { + throw new Error("🚨 Static Cursors directory is empty"); + } + return staticCursors; } - return staticCursors; } /**