From 85d0083f4055c3270b06d2d8cd73de955e4d8f54 Mon Sep 17 00:00:00 2001 From: ful1e5 <24286590+ful1e5@users.noreply.github.com> Date: Fri, 28 Aug 2020 11:56:14 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=97=20Paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index aff1781..b8de642 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,6 +18,14 @@ const main = async () => { headless: true, }); + // Paths + if (fs.existsSync(svgsDir)) { + console.log("Source .svg files not found"); + } + if (!fs.existsSync(bitmapsDir)) { + fs.mkdirSync(bitmapsDir); + } + try { console.log("šŸ“ø Rendering Static Cursors..."); // Rendering satic .svg files @@ -89,11 +97,11 @@ const main = async () => { await page.close(); } + + console.log(`\nBitmaps stored at ${bitmapsDir}\n\nšŸŽ‰ Render Done.`); } catch (error) { console.error(error); - } finally { - console.log(`\nBitmaps stored at ${bitmapsDir}\n\nšŸŽ‰ Render Done.`); - process.exit(0); + process.exit(1); } };