(p: string)
| 12 | import { loadServerHierarchicalMemory } from '@anus-dev/anus-core'; |
| 13 | |
| 14 | export 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 | |
| 27 | export const directoryCommand: SlashCommand = { |
| 28 | name: 'directory', |
no outgoing calls
no test coverage detected