| 2 | import * as path from "path"; |
| 3 | |
| 4 | const copyFiles = async (srcDir: string, destDir: string) => { |
| 5 | await fs.mkdir(destDir, { recursive: true }); |
| 6 | const files = await fs.readdir(srcDir); |
| 7 | for (const file of files) { |
| 8 | if (file.startsWith(".")) { |
| 9 | continue; |
| 10 | } |
| 11 | const srcFile = path.join(srcDir, file); |
| 12 | const destFile = path.join(destDir, file); |
| 13 | const stat = await fs.stat(srcFile); |
| 14 | if (stat.isFile()) { |
| 15 | await fs.copyFile(srcFile, destFile); |
| 16 | console.log(`Copied ${srcFile} to ${destFile}`); |
| 17 | } |
| 18 | } |
| 19 | }; |
| 20 | |
| 21 | async function main() { |
| 22 | // pg_dump is not yet available from CI, so we download as precompiled |