(options)
| 318 | |
| 319 | // Populates process.env from .env file |
| 320 | function config (options) { |
| 321 | // fallback to original dotenv if DOTENV_KEY is not set |
| 322 | if (_dotenvKey(options).length === 0) { |
| 323 | return DotenvModule.configDotenv(options) |
| 324 | } |
| 325 | |
| 326 | const vaultPath = _vaultPath(options) |
| 327 | |
| 328 | // dotenvKey exists but .env.vault file does not exist |
| 329 | if (!vaultPath) { |
| 330 | _warn(`you set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}`) |
| 331 | |
| 332 | return DotenvModule.configDotenv(options) |
| 333 | } |
| 334 | |
| 335 | return DotenvModule._configVault(options) |
| 336 | } |
| 337 | |
| 338 | function decrypt (encrypted, keyStr) { |
| 339 | const key = Buffer.from(keyStr.slice(-64), 'hex') |
no test coverage detected
searching dependent graphs…