MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / resolveCommandViaLoginShell

Function resolveCommandViaLoginShell

apps/desktop/src/main/login-shell-path.ts:36–46  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

34 * command name there).
35 */
36export async function resolveCommandViaLoginShell(command: string): Promise<string | null> {
37 if (!SAFE_COMMAND.test(command)) return null
38 if (process.platform === 'win32') return null
39
40 const cached = cache.get(command)
41 if (cached && Date.now() - cached.at < RESOLUTION_TTL_MS) return cached.value
42
43 const value = await queryLoginShell(command)
44 cache.set(command, { at: Date.now(), value })
45 return value
46}
47
48async function queryLoginShell(command: string): Promise<string | null> {
49 // Try the user's own shell first, then the standard POSIX shells. On

Callers 2

searchExecutableFunction · 0.90

Calls 1

queryLoginShellFunction · 0.85

Tested by

no test coverage detected