mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-08 10:46:06 +00:00
fix(cli): hide Windows child process consoles (#3529)
Rebase #3529 onto current main. Preserve all 16 issue-scoped Studio server, lint, and CLI child-process windowsHide options, including main's PowerShell null guards and stderr suppression in orphanCleanup. Regression tests continue to assert windowsHide at each scoped spawn site. #3476 and #3430 remain out of scope. Co-authored-by: heygengenesis[bot] <262951085+heygengenesis[bot]@users.noreply.github.com> Co-authored-by: miguel.sierra <229591595+miguel-heygen@users.noreply.github.com>
This commit is contained in:
co-authored by
miguel.sierra
parent
73aa71c9ec
commit
9097d539b1
@@ -27,7 +27,7 @@ const PROBE_CONCURRENCY = 8;
|
||||
|
||||
function execFileAsync(file: string, args: string[]): Promise<string> {
|
||||
return new Promise((resolvePromise, reject) => {
|
||||
execFile(file, args, { timeout: PROBE_TIMEOUT_MS }, (error, stdout) => {
|
||||
execFile(file, args, { timeout: PROBE_TIMEOUT_MS, windowsHide: true }, (error, stdout) => {
|
||||
if (error) reject(error);
|
||||
else resolvePromise(stdout.toString());
|
||||
});
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const { execFileMock } = vi.hoisted(() => ({ execFileMock: vi.fn() }));
|
||||
|
||||
vi.mock("node:child_process", () => {
|
||||
const mocked = { execFile: execFileMock };
|
||||
return { ...mocked, default: mocked };
|
||||
});
|
||||
vi.mock("@hyperframes/parsers/ff-binaries", () => ({
|
||||
findFfBinary: () => "/fake/bin/ffprobe",
|
||||
}));
|
||||
|
||||
import { lintHevcPreviewCodec } from "./hevcPreviewLint.js";
|
||||
|
||||
describe("HEVC preview probe options", () => {
|
||||
it("hides the ffprobe console window", async () => {
|
||||
execFileMock.mockImplementation(
|
||||
(
|
||||
_command: string,
|
||||
_args: string[],
|
||||
_options: unknown,
|
||||
callback: (...args: unknown[]) => void,
|
||||
) => {
|
||||
callback(null, JSON.stringify({ streams: [{ codec_name: "hevc" }] }));
|
||||
},
|
||||
);
|
||||
|
||||
await lintHevcPreviewCodec(new Map([["/tmp/clip.mp4", "clip.mp4"]]));
|
||||
|
||||
expect(execFileMock.mock.calls[0]?.[2]).toEqual(expect.objectContaining({ windowsHide: true }));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user