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

Function shouldReplaceDaemonForDesktop

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

bundledExecutorPathFunction · 0.90
normalizedPathFunction · 0.85

Tested by

no test coverage detected