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

Function removeDockerVolumes

packages/setupWizard/src/index.ts:302–320  ·  view source on GitHub ↗
(volumes: string[])

Source from the content-addressed store, hash-verified

300}
301
302async function removeDockerVolumes(volumes: string[]): Promise<boolean> {
303 if (volumes.length === 0) {
304 return true;
305 }
306 return new Promise<boolean>((resolve) => {
307 const child = spawn('docker', ['volume', 'rm', ...volumes], { stdio: ['ignore', 'ignore', 'pipe'] });
308 let err = '';
309 child.stderr?.on('data', (chunk: Buffer) => {
310 err += chunk.toString();
311 });
312 child.on('exit', (code) => {
313 if (code !== 0 && err.trim()) {
314 console.error(chalk.red('✗ ') + err.trim());
315 }
316 resolve(code === 0);
317 });
318 child.on('error', () => resolve(false));
319 });
320}
321
322type ComposeContainer = { Name: string; Service: string; State: string };
323

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected