mirror of
https://github.com/PR0M3TH3AN/Archivox.git
synced 2025-09-07 14:48:40 +00:00
fix(generator): copy top-level assets
This commit is contained in:
@@ -155,12 +155,18 @@ async function generate({ contentDir = 'content', outputDir = '_site', configPat
|
|||||||
await fs.promises.copyFile(srcPath, destPath);
|
await fs.promises.copyFile(srcPath, destPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy project level assets folder into output
|
// Copy the main assets directory (theme, js, etc.)
|
||||||
const projectAssets = path.resolve(__dirname, '..', '..', 'assets');
|
const mainAssetsSrc = path.resolve(
|
||||||
if (fs.existsSync(projectAssets)) {
|
configPath ? path.dirname(configPath) : process.cwd(),
|
||||||
const dest = path.join(outputDir, 'assets');
|
'..',
|
||||||
await fs.promises.mkdir(dest, { recursive: true });
|
'assets'
|
||||||
await fs.promises.cp(projectAssets, dest, { recursive: true });
|
);
|
||||||
|
const mainAssetsDest = path.join(outputDir, 'assets');
|
||||||
|
|
||||||
|
if (fs.existsSync(mainAssetsSrc)) {
|
||||||
|
console.log(`Copying main assets from ${mainAssetsSrc} to ${mainAssetsDest}`);
|
||||||
|
// Use fs.promises.cp for modern Node.js, it's like `cp -R`
|
||||||
|
await fs.promises.cp(mainAssetsSrc, mainAssetsDest, { recursive: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user