MCPcopy Index your code
hub / github.com/Waishnav/devspace / formatPathForPrompt

Function formatPathForPrompt

src/skills.ts:87–97  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

85}
86
87export function formatPathForPrompt(path: string): string {
88 const home = resolve(homedir());
89 const resolvedPath = resolve(path);
90
91 if (resolvedPath === home) return "~";
92 if (resolvedPath.startsWith(`${home}${sep}`)) {
93 return `~/${resolvedPath.slice(home.length + 1).split(sep).join("/")}`;
94 }
95
96 return resolvedPath.split(sep).join("/");
97}

Callers 2

skills.test.tsFile · 0.85
createMcpServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected