fix(BinaryLocator): Add filesystem fallback for validateBinaryExists when plugin unavailable

Improves binary validation by using fs.promises.access() as fallback when plugin context
is not available, ensuring cross-platform binary detection works reliably.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-09-25 16:37:10 +02:00
1 parent e084ff38cb
commit 0cd6b53687
1 file changed
+5 -1
+5 -1
View File
@@ -150,8 +150,12 @@ export class BinaryLocator {
private static async validateBinaryExists(binaryPath: string, plugin?: obsidianTypstPDFExport): Promise<boolean> {
try {
if (!plugin?.app) {
return false;
// This should not happen in normal plugin operation, but provide fallback
const fs = require('fs').promises;
await fs.access(binaryPath);
return true;
}
const pathUtils = new PathUtils(plugin.app);
return await pathUtils.fileExists(binaryPath);
} catch {