From 255832d26a3c9b39b1dae7b01054e15b158e1e3b Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Wed, 14 Dec 2022 21:26:40 +0400 Subject: [PATCH] add more logs --- package.json | 2 +- src/backend/build-static.ts | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f1ba949..deeae01 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "codex.docs", "license": "Apache-2.0", - "version": "v2.2.0-rc.3", + "version": "v2.2.0-rc.7", "type": "module", "bin": { "codex.docs": "dist/backend/app.js" diff --git a/src/backend/build-static.ts b/src/backend/build-static.ts index d8d4538..86a4f87 100644 --- a/src/backend/build-static.ts +++ b/src/backend/build-static.ts @@ -118,11 +118,22 @@ export default async function buildStatic(): Promise { console.log('Static files built'); console.log('Copy public directory'); - await fse.copy(path.resolve(dirname, '../../public'), distPath); + const publicDir = path.resolve(dirname, '../../public'); + + console.log(`Copy from ${publicDir} to ${distPath}`); + + try { + await fse.copy(publicDir, distPath); + console.log('Public directory copied'); + } catch (e) { + console.log('Error while copying public directory'); + console.error(e); + } if (appConfig.uploads.driver === 'local') { console.log('Copy uploads directory'); await fse.copy(path.resolve(cwd, appConfig.uploads.local.path), path.resolve(distPath, 'uploads')); + console.log('Uploads directory copied'); } }