()
| 348 | } |
| 349 | |
| 350 | async function listComposeContainers(): Promise<ComposeContainer[]> { |
| 351 | return new Promise<ComposeContainer[]>((resolve) => { |
| 352 | const child = spawn('docker', ['compose', 'ps', '-a', '--format', 'json'], { |
| 353 | stdio: ['ignore', 'pipe', 'ignore'], |
| 354 | }); |
| 355 | let out = ''; |
| 356 | child.stdout?.on('data', (chunk: Buffer) => { |
| 357 | out += chunk.toString(); |
| 358 | }); |
| 359 | child.on('exit', (code) => { |
| 360 | if (code !== 0) { |
| 361 | resolve([]); |
| 362 | return; |
| 363 | } |
| 364 | resolve(parseComposePsOutput(out)); |
| 365 | }); |
| 366 | child.on('error', () => resolve([])); |
| 367 | }); |
| 368 | } |
| 369 | |
| 370 | async function runComposeCommand(args: string[], label: string): Promise<boolean> { |
| 371 | return new Promise<boolean>((resolve) => { |
no test coverage detected