(file: string)
| 6 | const logger = new Logger('options'); |
| 7 | |
| 8 | function loadEnvFile(file: string) { |
| 9 | const content = fs.readFileSync(file).toString().replace(/\r/g, ''); |
| 10 | for (const line of content.split('\n')) { |
| 11 | if (!line.includes('=')) continue; |
| 12 | process.env[line.split('=')[0]] = line.split('=')[1].trim(); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | const profile = process.env.HYDRO_PROFILE; |
| 17 | export const hydroPath = profile ? path.resolve(os.homedir(), '.hydro', 'profiles', profile) : path.resolve(os.homedir(), '.hydro'); |