| 194 | const DEFAULT_EXIT_TIMEOUT = 3000; |
| 195 | |
| 196 | const attemptKillProcesses = async processes => { |
| 197 | try { |
| 198 | await fkill(processes); |
| 199 | const exitStatuses = await Promise.all(processes.map(process_ => processExited(process_, DEFAULT_EXIT_TIMEOUT))); |
| 200 | const survivors = processes.filter((_, index) => !exitStatuses[index]); |
| 201 | return {survivors, hadError: false}; |
| 202 | } catch { |
| 203 | return {survivors: processes, hadError: true}; |
| 204 | } |
| 205 | }; |
| 206 | |
| 207 | const promptForceKill = async (survivingProcesses, message) => { |
| 208 | if (process.stdout.isTTY === false) { |
no test coverage detected