From 4a1badb5aa4544e08f42a82f3adcea8acd8a6cc5 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 3 Aug 2026 02:37:32 +0100 Subject: [PATCH] Refactor Windows path handling in `windows-app-paths.js` - Removed the use of `chdirSync` in favor of `process.chdir` for changing the working directory, improving compatibility with the Node.js environment. - Streamlined the code for ensuring the correct working directory is set before launching the application on Windows. --- src/desktop/windows-app-paths.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/desktop/windows-app-paths.js b/src/desktop/windows-app-paths.js index e3511e6..2e4e582 100644 --- a/src/desktop/windows-app-paths.js +++ b/src/desktop/windows-app-paths.js @@ -1,4 +1,4 @@ -import { chdirSync, existsSync } from 'node:fs' +import { existsSync } from 'node:fs' import { dirname, join } from 'node:path' const NATIVE_WRAPPER_DLL = 'libNativeWrapper.dll' @@ -34,7 +34,7 @@ export function ensureWindowsWorkingDirectory() { if (!wrapperInCwd && wrapperInBinDir) { try { - chdirSync(binDir) + process.chdir(binDir) } catch { // Ignore if we cannot change directory. }