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

Function shouldReplaceDaemonForDesktop

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

Source from the content-addressed store, hash-verified

172const normalizedPath = (path: string): string => path.replaceAll("\\", "/");
173
174const shouldReplaceDaemonForDesktop = (conn: SidecarConnection): boolean => {
175 if (shouldUpgradeDaemonForDesktop(conn.ownerVersion)) return true;
176 if (!app.isPackaged) return false;
177 const ownerPath = conn.ownerExecutablePath;
178 if (!ownerPath) return false;
179 if (!existsSync(ownerPath)) return true;
180 if (conn.ownerClient !== "desktop") return false;
181 return normalizedPath(ownerPath) !== normalizedPath(bundledExecutorPath());
182};
183
184/** Poll for a reachable supervised daemon until the deadline. */
185const waitForSupervisedAttach = async (

Callers 1

Calls 3

bundledExecutorPathFunction · 0.90
normalizedPathFunction · 0.85

Tested by

no test coverage detected