MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / shouldReplaceDaemonForDesktop

Function shouldReplaceDaemonForDesktop

apps/desktop/src/main/index.ts:225–233  ·  view source on GitHub ↗
(conn: SidecarConnection)

Source from the content-addressed store, hash-verified

223const normalizedPath = (path: string): string => path.replaceAll("\\", "/");
224
225const shouldReplaceDaemonForDesktop = (conn: SidecarConnection): boolean => {
226 if (shouldUpgradeDaemonForDesktop(conn.ownerVersion)) return true;
227 if (!app.isPackaged) return false;
228 const ownerPath = conn.ownerExecutablePath;
229 if (!ownerPath) return false;
230 if (!existsSync(ownerPath)) return true;
231 if (conn.ownerClient !== "desktop") return false;
232 return normalizedPath(ownerPath) !== normalizedPath(bundledExecutorPath());
233};
234
235/** Poll for a reachable supervised daemon until the deadline. */
236const waitForSupervisedAttach = async (

Callers 1

Calls 3

bundledExecutorPathFunction · 0.90
normalizedPathFunction · 0.85

Tested by

no test coverage detected