diff --git a/.changeset/tasty-dots-peel.md b/.changeset/tasty-dots-peel.md new file mode 100644 index 00000000..2ab9c774 --- /dev/null +++ b/.changeset/tasty-dots-peel.md @@ -0,0 +1,5 @@ +--- +"pixeleye": patch +--- + +Improving exec cleanup diff --git a/integrations/cli/pixeleye/src/handlers/exec.ts b/integrations/cli/pixeleye/src/handlers/exec.ts index 97504cb1..1c83a0c6 100644 --- a/integrations/cli/pixeleye/src/handlers/exec.ts +++ b/integrations/cli/pixeleye/src/handlers/exec.ts @@ -68,7 +68,10 @@ export async function execHandler( }); onExitFns.push(async () => { - child.kill(); + child.stdin?.end(); + child.stdout?.destroy(); + child.stderr?.destroy(); + child.kill("SIGKILL"); }); fileSpinner.succeed("Successfully started local snapshot server."); @@ -166,7 +169,7 @@ export async function execHandler( console.log(`\nBuild status: ${finalStatus}`); } - child.kill(); + await Promise.all(onExitFns.map((fn) => fn())); process.exit(0); }