()
| 726 | * @returns {string} |
| 727 | */ |
| 728 | export const getUserHome = (): string => { |
| 729 | let variableName = 'HOME' |
| 730 | if (process.platform === 'win32') { |
| 731 | variableName = 'USERPROFILE' |
| 732 | } |
| 733 | |
| 734 | if (process.env[variableName] === undefined) { |
| 735 | // If for some reason the variable does not exist, fall back to current folder |
| 736 | return process.cwd() |
| 737 | } |
| 738 | return process.env[variableName] as string |
| 739 | } |
| 740 | |
| 741 | /** |
| 742 | * Map ChatMessage to BaseMessage |
no outgoing calls
no test coverage detected