import fs from 'node:fs/promises';
import path from 'node:path';

const projectRoot = process.cwd();

const src = path.join(projectRoot, 'api', 'database', 'init.sql');
const destDir = path.join(projectRoot, 'dist', 'api', 'database');
const dest = path.join(destDir, 'init.sql');

await fs.mkdir(destDir, { recursive: true });
await fs.copyFile(src, dest);

console.log(`Copied init.sql -> ${dest}`);
