Files
ldap-identidy/apps/api/scripts/copy-mail-assets.js
Bastian Wagner d30d9cfdde angular
2026-07-17 14:34:44 +02:00

27 lines
713 B
JavaScript

const { copyFileSync, existsSync, mkdirSync, readdirSync, statSync } = require('node:fs');
const { join } = require('node:path');
function copyDirectory(from, to) {
if (!existsSync(from)) {
return;
}
mkdirSync(to, { recursive: true });
for (const entry of readdirSync(from)) {
const sourcePath = join(from, entry);
const targetPath = join(to, entry);
if (statSync(sourcePath).isDirectory()) {
copyDirectory(sourcePath, targetPath);
} else {
copyFileSync(sourcePath, targetPath);
}
}
}
for (const feature of ['mail', 'oidc']) {
copyDirectory(
join(__dirname, '..', 'src', feature, 'templates'),
join(__dirname, '..', 'dist', feature, 'templates'),
);
}