MCPcopy
hub / github.com/microsoft/playwright / cleanup

Function cleanup

packages/utils/processLauncher.ts:146–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144 const spawnedProcess = childProcess.spawn(options.command, options.args || [], spawnOptions);
145
146 const cleanup = async () => {
147 options.log(`[pid=${spawnedProcess.pid || 'N/A'}] starting temporary directories cleanup`);
148 const errors = await removeFolders(options.tempDirectories);
149 for (let i = 0; i < options.tempDirectories.length; ++i) {
150 if (errors[i])
151 options.log(`[pid=${spawnedProcess.pid || 'N/A'}] exception while removing ${options.tempDirectories[i]}: ${errors[i]}`);
152 }
153 options.log(`[pid=${spawnedProcess.pid || 'N/A'}] finished temporary directories cleanup`);
154 };
155
156 // Prevent Unhandled 'error' event.
157 spawnedProcess.on('error', () => {});

Callers 1

launchProcessFunction · 0.70

Calls 2

removeFoldersFunction · 0.90
logMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…