MCPcopy Index your code
hub / github.com/zh-lx/code-inspector / getRelativePath

Function getRelativePath

packages/core/src/server/server.ts:29–34  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

27// 项目根目录
28export const ProjectRootPath = getProjectRoot();
29export function getRelativePath(filePath: string): string {
30 if (ProjectRootPath) {
31 return filePath.replace(`${ProjectRootPath}/`, '');
32 }
33 return filePath;
34}
35
36// 根据用户配置返回绝对路径或者相对路径
37export function getRelativeOrAbsolutePath(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected