Refactor Windows path handling in windows-app-paths.js
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good

- 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.
This commit is contained in:
Tom Butcher 2026-08-03 02:37:32 +01:00
parent 3d710e2d2e
commit 4a1badb5aa

View File

@ -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.
}