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:
1 file changed
+2
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user