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

Function shouldReplaceDaemonForDesktop

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

Source from the content-addressed store, hash-verified

183const normalizedPath = (path: string): string => path.replaceAll("\\", "/");
184
185const shouldReplaceDaemonForDesktop = (conn: SidecarConnection): boolean => {
186 if (shouldUpgradeDaemonForDesktop(conn.ownerVersion)) return true;
187 if (!app.isPackaged) return false;
188 const ownerPath = conn.ownerExecutablePath;
189 if (!ownerPath) return false;
190 if (!existsSync(ownerPath)) return true;
191 if (conn.ownerClient !== "desktop") return false;
192 return normalizedPath(ownerPath) !== normalizedPath(bundledExecutorPath());
193};
194
195/** Poll for a reachable supervised daemon until the deadline. */
196const waitForSupervisedAttach = async (

Callers 1

Calls 3

bundledExecutorPathFunction · 0.90
normalizedPathFunction · 0.85

Tested by

no test coverage detected