MCPcopy Create free account
hub / github.com/anus-dev/ANUS / resolvePath

Function resolvePath

packages/cli/src/utils/resolvePath.ts:11–22  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

9import * as path from 'path';
10
11export function resolvePath(p: string): string {
12 if (!p) {
13 return '';
14 }
15 let expandedPath = p;
16 if (p.toLowerCase().startsWith('%userprofile%')) {
17 expandedPath = os.homedir() + p.substring('%userprofile%'.length);
18 } else if (p === '~' || p.startsWith('~/')) {
19 expandedPath = os.homedir() + p.substring(1);
20 }
21 return path.normalize(expandedPath);
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected