()
| 8 | let cachedUserDataPath: string | null = null |
| 9 | |
| 10 | function getDefaultElectronUserDataPath() { |
| 11 | switch (process.platform) { |
| 12 | case 'darwin': |
| 13 | return path.join(os.homedir(), 'Library', 'Application Support', 'howcode') |
| 14 | case 'win32': |
| 15 | return path.join( |
| 16 | getProcessEnvironmentVariable('APPDATA') || path.join(os.homedir(), 'AppData', 'Roaming'), |
| 17 | 'howcode', |
| 18 | ) |
| 19 | default: |
| 20 | return path.join( |
| 21 | getProcessEnvironmentVariable('XDG_CONFIG_HOME') || path.join(os.homedir(), '.config'), |
| 22 | 'howcode', |
| 23 | ) |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | export function getDesktopUserDataPath() { |
| 28 | if (cachedUserDataPath) { |
no test coverage detected