Refactors exec invocation in PdfCliExecutor

Moves the promisify exec function outside the render method
for clarity and potential reuse, improving code structure.
This commit is contained in:
AlexKucera committed 2025-11-08 18:45:04 +01:00
1 parent 1ac2807320
commit 6098f99c68
1 file changed
+2 -2
+2 -2
View File
@@ -10,6 +10,8 @@ import { BinaryLocator } from './BinaryLocator';
import { EnvironmentUtils } from './EnvironmentUtils';
import type { obsidianTypstPDFExport } from '../../../main';
const execAsync = promisify(exec);
export interface PdfCliOptions {
/** Scale factor for the rendered image */
scale: number;
@@ -113,8 +115,6 @@ export class PdfCliExecutor {
plugin?: obsidianTypstPDFExport
): Promise<PdfCliResult> {
try {
const execAsync = promisify(exec);
// Get augmented environment for CLI execution
const env = EnvironmentUtils.getAugmentedEnvironment(plugin?.settings);