()
| 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', () => {}); |
no test coverage detected
searching dependent graphs…