1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-19 21:29:41 +02:00

Fixed copy button path in header.twig, code.twig (#290)

* Fixed copy button path in header.twig

* Fixed path of copy button in code.twig, updated version

* add more logs

* Added overwrite property

* update version

Co-authored-by: Nikita Melnikov <nikmel2803@gmail.com>
This commit is contained in:
Vyacheslav Chernyshev 2022-12-27 16:10:18 +03:00 committed by GitHub
parent d3e0cb176c
commit f78b9ecff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 6 deletions

View file

@ -45,8 +45,10 @@ export default async function buildStatic(): Promise<void> {
});
}
console.log('Removing old static files');
await fse.remove(distPath);
if (config.overwrite) {
console.log('Removing old static files');
await fse.remove(distPath);
}
console.log('Building static files');
const pagesOrder = await PagesOrder.getAll();
@ -118,11 +120,22 @@ export default async function buildStatic(): Promise<void> {
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');
}
}