Skip to content

Commit

Permalink
Handling spaces in user defined Xournal++ path (fixes #11).
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjampen committed Jan 23, 2025
1 parent 2ae26a8 commit 5bfacc4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export async function checkXoppSetup(plugin: XoppPlugin): Promise<string> {

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)
}
}
Expand Down Expand Up @@ -59,4 +60,4 @@ function executeCommand(command: string): Promise<void> {
}
});
});
}
}

0 comments on commit 5bfacc4

Please sign in to comment.