1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-18 20:59:42 +02:00

add error handler for creating dist folder

This commit is contained in:
Nikita Melnikov 2022-12-28 04:16:24 +04:00
parent f78b9ecff5
commit c668ab1579
2 changed files with 10 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{
"name": "codex.docs",
"license": "Apache-2.0",
"version": "v2.2.0-rc.11",
"version": "v2.2.0-rc.12",
"type": "module",
"bin": {
"codex.docs": "dist/backend/app.js"

View file

@ -54,7 +54,15 @@ export default async function buildStatic(): Promise<void> {
const pagesOrder = await PagesOrder.getAll();
const allPages = await Page.getAll();
await mkdirp(distPath);
try {
console.log('Create dist folder');
await mkdirp(distPath);
} catch (e) {
console.log('Error while creating dist folder', e);
return;
}
/**
* Renders single page