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:
parent
d3e0cb176c
commit
f78b9ecff5
5 changed files with 20 additions and 6 deletions
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue