()
| 31 | } |
| 32 | |
| 33 | function getDotEnvPath(): string { |
| 34 | const dotEnvPath = resolve(getProjectRootPath(), '.env'); |
| 35 | const dotEnvWithEnvPath = resolve(getProjectRootPath(), getDotEnvFileName()); |
| 36 | |
| 37 | // look for .env.<env> |
| 38 | if (existsSync(dotEnvWithEnvPath)) { |
| 39 | return dotEnvWithEnvPath; |
| 40 | } |
| 41 | |
| 42 | // fall back to .env |
| 43 | if (existsSync(dotEnvPath)) { |
| 44 | return dotEnvPath; |
| 45 | } |
| 46 | |
| 47 | // don't use .env |
| 48 | return null; |
| 49 | } |
no test coverage detected