MCPcopy
hub / github.com/blitz-js/blitz / killProcess

Function killProcess

integration-tests/utils/next-test-utils.ts:525–548  ·  view source on GitHub ↗
(pid)

Source from the content-addressed store, hash-verified

523}
524
525export async function killProcess(pid) {
526 await new Promise<void>((resolve, reject) => {
527 treeKill(pid, (err) => {
528 if (err) {
529 if (
530 process.platform === "win32" &&
531 typeof err.message === "string" &&
532 (err.message.includes(`no running instance of the task`) ||
533 err.message.includes(`not found`))
534 ) {
535 // Windows throws an error if the process is already dead
536 //
537 // Command failed: taskkill /pid 6924 /T /F
538 // ERROR: The process with PID 6924 (child process of PID 6736) could not be terminated.
539 // Reason: There is no running instance of the task.
540 return resolve()
541 }
542 return reject(err)
543 }
544
545 resolve()
546 })
547 })
548}
549
550// Kill a launched app
551export async function killApp(instance) {

Callers 1

killAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected