From 24843ec040301b4e9287fe441bfab1953ef998a6 Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Sat, 8 Oct 2022 23:02:34 +0800 Subject: [PATCH] some fixes --- .gitignore | 2 +- docs-config.yaml | 2 +- package.json | 2 +- src/backend/build-static.ts | 10 ++++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 26dcdf2..48196e3 100644 --- a/.gitignore +++ b/.gitignore @@ -75,7 +75,7 @@ db/ .DS_Store # Uploads -/public/uploads +/uploads /public/uploads_test # Compiled files diff --git a/docs-config.yaml b/docs-config.yaml index 573a981..26de628 100644 --- a/docs-config.yaml +++ b/docs-config.yaml @@ -3,7 +3,7 @@ host: "localhost" uploads: driver: "local" local: - path: "./public/uploads" + path: "./uploads" s3: bucket: "my-bucket" region: "eu-central-1" diff --git a/package.json b/package.json index fb6c21d..8995853 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "codex.docs", "license": "Apache-2.0", - "version": "0.0.1-alpha.6", + "version": "0.0.1-alpha.8", "type": "module", "bin": { "codex.docs": "dist/backend/app.js" diff --git a/src/backend/build-static.ts b/src/backend/build-static.ts index 3062a56..a045de8 100644 --- a/src/backend/build-static.ts +++ b/src/backend/build-static.ts @@ -112,8 +112,14 @@ export default async function buildStatic(): Promise { } await renderIndexPage(config.indexPageUri); - - await fse.copy(path.resolve(dirname, '../../public'), distPath); console.log('Static files built'); + + console.log('Copy public directory'); + await fse.copy(path.resolve(dirname, '../../public'), distPath); + + if (appConfig.uploads.driver === 'local') { + console.log('Copy uploads directory'); + await fse.copy(path.resolve(cwd, appConfig.uploads.local.path), path.resolve(distPath, 'uploads')); + } }