import { copyFileSync, mkdirSync, existsSync } from 'fs';
import { join, dirname } from 'path';
import { fileURLToPath } from 'url';

const root = join(dirname(fileURLToPath(import.meta.url)), '..');
const src = join(root, 'node_modules', 'bootstrap', 'dist', 'css', 'bootstrap.min.css');
const destDir = join(root, 'public', 'css');
const dest = join(destDir, 'bootstrap.min.css');

if (existsSync(src)) {
  mkdirSync(destDir, { recursive: true });
  copyFileSync(src, dest);
  console.log('[copy-bootstrap-css] Copied Bootstrap CSS to public/css/');
}
