MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getDisplayPath

Function getDisplayPath

source code/utils/file.ts:157–172  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

155}
156
157export function getDisplayPath(filePath: string): string {
158 // Use relative path if file is in the current working directory
159 const { relativePath } = getAbsoluteAndRelativePaths(filePath)
160 if (relativePath && !relativePath.startsWith('..')) {
161 return relativePath
162 }
163
164 // Use tilde notation for files in home directory
165 const homeDir = homedir()
166 if (filePath.startsWith(homeDir + sep)) {
167 return '~' + filePath.slice(homeDir.length)
168 }
169
170 // Otherwise return the absolute path
171 return filePath
172}
173
174/**
175 * Find files with the same name but different extensions in the same directory

Callers 15

renderToolUseMessageFunction · 0.85
getToolUseSummaryFunction · 0.85
renderToolUseMessageFunction · 0.85
renderToolUseMessageFunction · 0.85
getToolUseSummaryFunction · 0.85
_tempFunction · 0.85
getToolUseSummaryFunction · 0.85
renderToolUseMessageFunction · 0.85
runAgentFunction · 0.85
renderToolResultMessageFunction · 0.85
getToolUseSummaryFunction · 0.85

Calls 1

Tested by

no test coverage detected