MCPcopy
hub / github.com/anomalyco/opencode / checkMacosApp

Function checkMacosApp

packages/desktop/src/main/apps.ts:24–37  ·  view source on GitHub ↗
(appName: string)

Source from the content-addressed store, hash-verified

22}
23
24async function checkMacosApp(appName: string) {
25 const locations = [`/Applications/${appName}.app`, `/System/Applications/${appName}.app`]
26
27 const home = process.env.HOME
28 if (home) locations.push(`${home}/Applications/${appName}.app`)
29
30 for (const location of locations) {
31 if (await exists(location)) return true
32 }
33
34 return execFilePromise("which", [appName])
35 .then(() => true)
36 .catch(() => false)
37}
38
39async function resolveWindowsAppPath(appName: string): Promise<string | null> {
40 let output: string

Callers 1

checkAppExistsFunction · 0.85

Calls 2

pushMethod · 0.80
existsFunction · 0.70

Tested by

no test coverage detected