probe.mjs 397 B

12345678910
  1. import { execFile } from "node:child_process";
  2. import { promisify } from "node:util";
  3. // Windows 入口是 shim(zcode-soffice.exe),不经 shell 也能按 PATH 找到。
  4. const { stdout } = await promisify(execFile)("zcode-soffice", ["--fixture-location"]);
  5. console.log(
  6. JSON.stringify({
  7. executable: stdout.trim(),
  8. available: process.env.ZCODE_PREINSTALLED_TOOLS_AVAILABLE,
  9. }),
  10. );