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

Function shouldReplaceDaemonForDesktop

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

bundledExecutorPathFunction · 0.90
normalizedPathFunction · 0.85

Tested by

no test coverage detected