fix: ensure proper type casting for Windows compatibility in LibreOffice checks

This commit is contained in:
sudipnext 2026-03-25 11:26:28 +05:45
parent 43f433597b
commit f446b7eb55

View file

@ -286,7 +286,7 @@ export async function isLibreOfficeInstalled(): Promise<LibreOfficeCheckResult>
const quoted = `"${candidate}"`;
const { stdout } = await execAsync(`${quoted} --version`, {
timeout: 8_000,
windowsHide: process.platform === "win32",
windowsHide: (process.platform as string) === "win32",
});
return { installed: true, version: stdout.trim(), path: candidate };
} catch {
@ -320,7 +320,7 @@ export async function isLibreOfficeInstalled(): Promise<LibreOfficeCheckResult>
try {
const { stdout } = await execAsync("soffice --version", {
timeout: 8_000,
windowsHide: process.platform === "win32",
windowsHide: (process.platform as string) === "win32",
});
// Found via PATH record the bare command name as the path so callers
// can pass it directly to subprocess invocations.
@ -426,4 +426,4 @@ export async function checkLibreOfficeBeforeWindow(
// Always proceed never block the app
return true;
}
}