mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-25 16:37:32 +00:00
* fix(cli): Windows process reads and Chrome cleanup no longer pass PowerShell command text * fix(cli): a forced Chrome close on Windows ends what Chrome started * test(cli): the forced-close test's child holds no pipe to the browser * test(cli): the forced-close test's child outlives a dead parent, as Chrome's do * test(cli): forced-close test waits for the kill; PowerShell starts only via processReadArgs * fix(cli): Windows cleanup ends only a process the CLI started, never a pid it was handed
18 lines
543 B
TypeScript
18 lines
543 B
TypeScript
import { fileURLToPath } from "node:url";
|
|
|
|
type ProcessRead = "identity" | "parent" | "table" | "version";
|
|
|
|
/** One read of processes.ps1, shipped beside this code; antivirus flags PowerShell given command text. */
|
|
export function processReadArgs(read: ProcessRead, target?: string | number): string[] {
|
|
return [
|
|
"-NoProfile",
|
|
"-NonInteractive",
|
|
"-ExecutionPolicy",
|
|
"Bypass",
|
|
"-File",
|
|
fileURLToPath(new URL("./processes.ps1", import.meta.url)),
|
|
read,
|
|
...(target === undefined ? [] : [String(target)]),
|
|
];
|
|
}
|