(paths?: EnvPaths)
| 51 | } |
| 52 | |
| 53 | function resolvePaths(paths?: EnvPaths): Required<EnvPaths> { |
| 54 | const envFile = paths?.envFile ?? DEFAULT_ENV_FILE; |
| 55 | |
| 56 | // For the default env file, keep the canonical names used elsewhere in setup. |
| 57 | // For overrides (e.g. .env_test), derive adjacent backup/temp files. |
| 58 | const backupFile = |
| 59 | paths?.backupFile ?? |
| 60 | (envFile === DEFAULT_ENV_FILE |
| 61 | ? DEFAULT_ENV_BACKUP_FILE |
| 62 | : `${envFile}.backup`); |
| 63 | const tempFile = |
| 64 | paths?.tempFile ?? |
| 65 | (envFile === DEFAULT_ENV_FILE ? DEFAULT_ENV_TEMP_FILE : `${envFile}.tmp`); |
| 66 | |
| 67 | return { |
| 68 | envFile, |
| 69 | backupFile, |
| 70 | tempFile, |
| 71 | }; |
| 72 | } |
| 73 | |
| 74 | export async function checkEnvFile( |
| 75 | envFile: string = DEFAULT_ENV_FILE, |
no outgoing calls
no test coverage detected