🔗 Paths

This commit is contained in:
ful1e5 2020-08-28 11:56:14 +05:30
parent f3f3778ab2
commit 85d0083f40

View file

@ -18,6 +18,14 @@ const main = async () => {
headless: true, headless: true,
}); });
// Paths
if (fs.existsSync(svgsDir)) {
console.log("Source .svg files not found");
}
if (!fs.existsSync(bitmapsDir)) {
fs.mkdirSync(bitmapsDir);
}
try { try {
console.log("📸 Rendering Static Cursors..."); console.log("📸 Rendering Static Cursors...");
// Rendering satic .svg files // Rendering satic .svg files
@ -89,11 +97,11 @@ const main = async () => {
await page.close(); await page.close();
} }
console.log(`\nBitmaps stored at ${bitmapsDir}\n\n🎉 Render Done.`);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
} finally { process.exit(1);
console.log(`\nBitmaps stored at ${bitmapsDir}\n\n🎉 Render Done.`);
process.exit(0);
} }
}; };