| 33 | const composeFile = path.join(here, 'docker-compose.e2e.yml') |
| 34 | |
| 35 | const run = (command: string, args: string[]) => { |
| 36 | const result = spawnSync(command, args, { cwd: here, stdio: 'inherit' }) |
| 37 | if (result.error) { |
| 38 | const errno = result.error as NodeJS.ErrnoException |
| 39 | if (errno.code === 'ENOENT') { |
| 40 | console.error( |
| 41 | `Error: '${command}' command not found. Please ensure ${command} is installed and in your PATH.` |
| 42 | ) |
| 43 | } else { |
| 44 | console.error(`Error executing '${command}':`, result.error.message) |
| 45 | } |
| 46 | process.exit(1) |
| 47 | } |
| 48 | if (result.status !== 0) { |
| 49 | process.exit(result.status ?? 1) |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | const waitForPostgres = async ( |
| 54 | url: string, |