From 5bfacc49eda8ebe376624302592518882f827705 Mon Sep 17 00:00:00 2001 From: Jon Jampen Date: Mon, 20 Jan 2025 14:02:07 +0100 Subject: [PATCH] Handling spaces in user defined Xournal++ path (fixes #11). --- src/checks.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/checks.ts b/src/checks.ts index b36af6e..9fa7a08 100644 --- a/src/checks.ts +++ b/src/checks.ts @@ -12,9 +12,10 @@ export async function checkXoppSetup(plugin: XoppPlugin): Promise { if (userPath) { try { - await executeCommand(userPath + versionCmd); - return userPath; - } catch (error) { + if(!userPath.startsWith('"') || !userPath.endsWith('"')) userPath =`"${userPath}"`; + await executeCommand(userPath + versionCmd); + return userPath; + } catch (error) { errors.push("User defined Xournal++ path not working: " + error.message) } } @@ -59,4 +60,4 @@ function executeCommand(command: string): Promise { } }); }); -} \ No newline at end of file +}