diff --git a/server/utils/path.js b/server/utils/path.js index 0f51a781..b6e2e16f 100644 --- a/server/utils/path.js +++ b/server/utils/path.js @@ -36,6 +36,11 @@ function executablePath(execPath, execName) { console.log("[executablePath]", { execPath, execName, mode, nodeEnv, resourcesPath }); + if (commandExistsSync(osExecutableName)) { + console.log(`[executablePath] Found executable in PATH: ${osExecutableName}`); + return osExecutableName; + } + const foundAtExecPath = findExecutableInDir(execPath, execName, osExecutableName); if (foundAtExecPath) { return foundAtExecPath; @@ -51,11 +56,6 @@ function executablePath(execPath, execName) { ); } - if (commandExistsSync(osExecutableName)) { - console.log(`[executablePath] Found executable in PATH: ${osExecutableName}`); - return osExecutableName; - } - throw new Error(`Executable not found: ${osExecutableName}`); }