MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / listComposeContainers

Function listComposeContainers

packages/setupWizard/src/index.ts:350–368  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

348}
349
350async 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
370async function runComposeCommand(args: string[], label: string): Promise<boolean> {
371 return new Promise<boolean>((resolve) => {

Callers 1

mainFunction · 0.85

Calls 1

parseComposePsOutputFunction · 0.85

Tested by

no test coverage detected