Refactor Windows app path handling to remove unnecessary directory change
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ui/pipeline/head This commit looks good
- 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.
This commit is contained in:
parent
e1051499f9
commit
27e5ef13bc
@ -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.
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user