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

Function expandHomeDir

packages/cli/src/ui/commands/directoryCommand.tsx:14–25  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

12import { loadServerHierarchicalMemory } from '@anus-dev/anus-core';
13
14export function expandHomeDir(p: string): string {
15 if (!p) {
16 return '';
17 }
18 let expandedPath = p;
19 if (p.toLowerCase().startsWith('%userprofile%')) {
20 expandedPath = os.homedir() + p.substring('%userprofile%'.length);
21 } else if (p === '~' || p.startsWith('~/')) {
22 expandedPath = os.homedir() + p.substring(1);
23 }
24 return path.normalize(expandedPath);
25}
26
27export const directoryCommand: SlashCommand = {
28 name: 'directory',

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected