Comparing version 16.4.0 to 16.4.1
@@ -5,4 +5,8 @@ # Changelog | ||
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.4.0...master) | ||
## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.4.1...master) | ||
## [16.4.1](https://github.com/motdotla/dotenv/compare/v16.4.0...v16.4.1) (2024-01-24) | ||
- Patch support for array as `path` option [#797](https://github.com/motdotla/dotenv/pull/797) | ||
## [16.4.0](https://github.com/motdotla/dotenv/compare/v16.3.2...v16.4.0) (2024-01-23) | ||
@@ -9,0 +13,0 @@ |
@@ -212,3 +212,14 @@ const fs = require('fs') | ||
if (options.path != null) { | ||
dotenvPath = _resolveHome(options.path) | ||
let envPath = options.path | ||
if (Array.isArray(envPath)) { | ||
for (const filepath of options.path) { | ||
if (fs.existsSync(filepath)) { | ||
envPath = filepath | ||
break | ||
} | ||
} | ||
} | ||
dotenvPath = _resolveHome(envPath) | ||
} | ||
@@ -215,0 +226,0 @@ if (options.encoding != null) { |
{ | ||
"name": "dotenv", | ||
"version": "16.4.0", | ||
"version": "16.4.1", | ||
"description": "Loads environment variables from .env file", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
<div align="center"> | ||
π announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. *run anywhere, multi-environment, encrypted envs*. | ||
</div> | ||
--- | ||
<div align="center"> | ||
<p> | ||
@@ -4,0 +10,0 @@ <sup> |
<div align="center"> | ||
π announcing <a href="https://github.com/dotenvx/dotenvx">dotenvx</a>. <em>run anywhere, multi-environment, encrypted envs</em>. | ||
</div> | ||
--- | ||
<div align="center"> | ||
<p> | ||
@@ -498,3 +504,3 @@ <sup> | ||
No. We **strongly** recommend against having a "main" `.env` file and an "environment" `.env` file like `.env.test`. Your config should vary between deploys, and you should not be sharing values between environments. | ||
We recommend creating on `.env` file per environment. Use `.env` for local/development, `.env.production` for production and so on. This still follows the twelve factor principles as each is attributed individually to its own environment. Avoid custom set ups that work in inheritance somehow (`.env.production` inherits values form `.env` for example). It is better to duplicate values if necessary across each `.env.environment` file. | ||
@@ -658,2 +664,24 @@ > In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as βenvironmentsβ, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime. | ||
### What if I accidentally commit my `.env` file to code? | ||
Remove it, [remove git history](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository) and then install the [git pre-commit hook](https://github.com/dotenvx/dotenvx#pre-commit) to prevent this from ever happening again. | ||
``` | ||
brew install dotenvx/brew/dotenvx | ||
dotenvx precommit --install | ||
``` | ||
### How can I prevent committing my `.env` file to a Docker build? | ||
Use the [docker prebuild hook](https://dotenvx.com/docs/features/prebuild). | ||
```bash | ||
# Dockerfile | ||
... | ||
RUN curl -fsS https://dotenvx.sh/ | sh | ||
... | ||
RUN dotenvx prebuild | ||
CMD ["dotenvx", "run", "--", "node", "index.js"] | ||
``` | ||
## Contributing Guide | ||
@@ -660,0 +688,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76016
461
698