| 220 | }; |
| 221 | |
| 222 | const performKillSequence = async processes => { |
| 223 | const processList = Array.isArray(processes) ? processes : [processes]; |
| 224 | const {survivors, hadError} = await attemptKillProcesses(processList); |
| 225 | |
| 226 | if (survivors.length === 0) { |
| 227 | return; |
| 228 | } |
| 229 | |
| 230 | const suffix = survivors.length > 1 ? 'es' : ''; |
| 231 | const message = hadError ? `Error killing process${suffix}.` : `Process${suffix} didn't exit in ${DEFAULT_EXIT_TIMEOUT}ms.`; |
| 232 | const shouldForceKill = await promptForceKill(survivors, message); |
| 233 | |
| 234 | if (shouldForceKill) { |
| 235 | await fkill(processList, { |
| 236 | force: true, |
| 237 | ignoreCase: true, |
| 238 | }); |
| 239 | } |
| 240 | }; |
| 241 | |
| 242 | const findPortsForProcess = (processId, portToPidMap) => { |
| 243 | const ports = []; |
no test coverage detected