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

Function resolve

packages/opencode/src/util/filesystem.ts:137–145  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

135// Also resolves symlinks so that callers using the result as a cache key
136// always get the same canonical path for a given physical directory.
137export function resolve(p: string): string {
138 const resolved = pathResolve(windowsPath(p))
139 try {
140 return normalizePath(realpathSync(resolved))
141 } catch (e) {
142 if (isEnoent(e)) return normalizePath(resolved)
143 throw e
144 }
145}
146
147export function resolveFilePath(root: string, file: string): string {
148 const raw = file.startsWith("file://") ? fileURLToPath(file) : file

Callers 4

pushMethod · 0.70
triggerFunction · 0.70
clientFunction · 0.70
spawnFunction · 0.70

Calls 3

isEnoentFunction · 0.85
windowsPathFunction · 0.70
normalizePathFunction · 0.70

Tested by

no test coverage detected