fix(process): capture complete host probe output

This commit is contained in:
morluto
2026-09-29 17:36:04 +08:00
parent dfad09e3b5
commit 6c68ff565f
8 changed files with 68 additions and 24 deletions
+2 -7
View File
@@ -1,9 +1,7 @@
import { execFile } from "node:child_process";
import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os";
import { basename, join } from "node:path";
import type { Readable } from "node:stream";
import { promisify } from "node:util";
import { parse } from "plist";
import { z } from "zod";
@@ -15,8 +13,7 @@ import {
type ArtifactReader,
} from "./ArtifactReader.js";
import { DirectoryArtifactReader } from "./DirectoryArtifactReader.js";
const execFileAsync = promisify(execFile);
import { execFileOutput } from "../process/ExecFileOutput.js";
const DETACH_TIMEOUT_MS = 120_000;
const attachOutputSchema = z.object({
"system-entities": z.array(
@@ -39,12 +36,10 @@ export interface NativeDmgHost {
const systemHost: NativeDmgHost = {
async run(arguments_, signal, options) {
try {
const { stdout } = await execFileAsync(
const { stdout } = await execFileOutput(
"/usr/bin/hdiutil",
[...arguments_],
{
encoding: "utf8",
maxBuffer: Number.POSITIVE_INFINITY,
...(options === undefined ? {} : { timeout: options.timeoutMs }),
...(signal === undefined ? {} : { signal }),
},