MCPcopy
hub / github.com/Waishnav/devspace / expandHomePath

Function expandHomePath

src/roots.ts:11–18  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

9}
10
11export function expandHomePath(path: string): string {
12 if (path === "~") return homedir();
13 if (path.startsWith("~/") || path.startsWith("~\\")) {
14 return resolve(homedir(), path.slice(2));
15 }
16
17 return path;
18}
19
20export function isPathInsideRoot(path: string, root: string): boolean {
21 const resolvedPath = resolve(expandHomePath(path));

Callers 9

resolveSkillPathFunction · 0.85
resolveSkillReadPathFunction · 0.85
parseAllowedRootsFunction · 0.85
loadConfigFunction · 0.85
roots.test.tsFile · 0.85
devspaceConfigDirFunction · 0.85
isPathInsideRootFunction · 0.85
assertAllowedPathFunction · 0.85
runInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected