MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / resolveProjectPathForComparison

Function resolveProjectPathForComparison

desktop/pi-threads/project-paths.ts:5–23  ·  view source on GitHub ↗
(projectId: string)

Source from the content-addressed store, hash-verified

3import type { Project } from '../../shared/desktop-contracts.ts'
4
5export async function resolveProjectPathForComparison(projectId: string) {
6 const resolvedProjectId = path.resolve(projectId)
7
8 try {
9 return await realpath(resolvedProjectId)
10 } catch (error) {
11 if (
12 typeof error === 'object' &&
13 error !== null &&
14 'code' in error &&
15 typeof error.code === 'string' &&
16 error.code !== 'ENOENT'
17 ) {
18 console.warn(`Failed to resolve project path for shell state: ${resolvedProjectId}`, error)
19 }
20
21 return resolvedProjectId
22 }
23}
24
25export async function enrichProjectsWithResolvedIds(projects: Project[]) {
26 return Promise.all(

Callers 3

loadShellStateFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected