()
| 112 | * |
| 113 | */ |
| 114 | export const getUserHome = (): string => { |
| 115 | let variableName = 'HOME' |
| 116 | if (process.platform === 'win32') { |
| 117 | variableName = 'USERPROFILE' |
| 118 | } |
| 119 | |
| 120 | if (process.env[variableName] === undefined) { |
| 121 | // If for some reason the variable does not exist |
| 122 | // fall back to current folder |
| 123 | return process.cwd() |
| 124 | } |
| 125 | return process.env[variableName] as string |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Returns the path of node modules package |
no outgoing calls
no test coverage detected