(command: string)
| 281 | const tunnelClosers: Array<() => void> = []; |
| 282 | |
| 283 | const ssh = async (command: string): Promise<SshResult> => { |
| 284 | try { |
| 285 | const { stdout, stderr } = await execFileP( |
| 286 | "ssh", |
| 287 | ["-i", keyPath, ...SSH_OPTS, `${user}@${ip}`, command], |
| 288 | { maxBuffer: 64 * 1024 * 1024 }, |
| 289 | ); |
| 290 | return { stdout, stderr, code: 0 }; |
| 291 | } catch (err) { |
| 292 | const e = err as { stdout?: string; stderr?: string; code?: number }; |
| 293 | return { |
| 294 | stdout: e.stdout ?? "", |
| 295 | stderr: e.stderr ?? "", |
| 296 | code: typeof e.code === "number" ? e.code : 1, |
| 297 | }; |
| 298 | } |
| 299 | }; |
| 300 | |
| 301 | const waitSshUp = async (attempts: number): Promise<boolean> => { |
| 302 | for (let i = 0; i < attempts; i++) { |
no outgoing calls
no test coverage detected