MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / resolveFilePath

Function resolveFilePath

cli/src/utils/image-handler.ts:100–109  ·  view source on GitHub ↗
(filePath: string, cwd: string)

Source from the content-addressed store, hash-verified

98 * Resolves a file path, handling ~, relative paths, etc.
99 */
100export function resolveFilePath(filePath: string, cwd: string): string {
101 const normalized = normalizeUserProvidedPath(filePath)
102 if (normalized.startsWith('~')) {
103 return path.join(homedir(), normalized.slice(1))
104 }
105 if (path.isAbsolute(normalized)) {
106 return normalized
107 }
108 return path.resolve(cwd, normalized)
109}
110
111/**
112 * Attempts to compress an image to fit within the max base64 size.

Callers 4

validateAndAddImageFunction · 0.90
getImageFilePathFromTextFunction · 0.90
processImageFileFunction · 0.85

Calls 1

Tested by

no test coverage detected