From 27e5ef13bc4de0ad573c5fb8fd4a7ed04b4476a9 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 3 Aug 2026 00:26:17 +0100 Subject: [PATCH] Refactor Windows app path handling to remove unnecessary directory change - Removed the `chdirSync` call in `ensureWindowsWorkingDirectory` function, replacing it with a check using `existsSync` to streamline the directory validation process. - This change enhances the reliability of the function by avoiding unnecessary directory changes that could lead to errors. --- 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..6d5cac2 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) + existsSync(binDir) } catch { // Ignore if we cannot change directory. }