-
-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Process multiple files in options.path, if provided. #805
Process multiple files in options.path, if provided. #805
Conversation
@motdotla Updated as requested. Little had to change in the code structure, as we need to hold a copy of the combined parsed object to return it. |
thank you. i should merged and released today. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #805 +/- ##
==========================================
Coverage ? 100.00%
==========================================
Files ? 4
Lines ? 193
Branches ? 0
==========================================
Hits ? 193
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dotenv](https://github.com/motdotla/dotenv) | dependencies | patch | [`16.4.1` -> `16.4.5`](https://renovatebot.com/diffs/npm/dotenv/16.4.1/16.4.5) | --- ### Release Notes <details> <summary>motdotla/dotenv (dotenv)</summary> ### [`v16.4.5`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1645-2024-02-19) [Compare Source](motdotla/dotenv@v16.4.4...v16.4.5) ##### Changed - 🐞 fix recent regression when using `path` option. return to historical behavior: do not attempt to auto find `.env` if `path` set. (regression was introduced in `16.4.3`) [#​814](motdotla/dotenv#814) ### [`v16.4.4`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1644-2024-02-13) [Compare Source](motdotla/dotenv@v16.4.3...v16.4.4) ##### Changed - 🐞 Replaced chaining operator `?.` with old school `&&` (fixing node 12 failures) [#​812](motdotla/dotenv#812) ### [`v16.4.3`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1643-2024-02-12) [Compare Source](motdotla/dotenv@v16.4.2...v16.4.3) ##### Changed - Fixed processing of multiple files in `options.path` [#​805](motdotla/dotenv#805) ### [`v16.4.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1642-2024-02-10) [Compare Source](motdotla/dotenv@v16.4.1...v16.4.2) ##### Changed - Changed funding link in package.json to [`dotenvx.com`](https://dotenvx.com) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/Droplet/pulls/269 Reviewed-by: Vylpes <ethan@vylpes.com> Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dotenv](https://github.com/motdotla/dotenv) | dependencies | minor | [`16.3.2` -> `16.4.5`](https://renovatebot.com/diffs/npm/dotenv/16.3.2/16.4.5) | --- ### Release Notes <details> <summary>motdotla/dotenv (dotenv)</summary> ### [`v16.4.5`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1645-2024-02-19) [Compare Source](motdotla/dotenv@v16.4.4...v16.4.5) ##### Changed - 🐞 fix recent regression when using `path` option. return to historical behavior: do not attempt to auto find `.env` if `path` set. (regression was introduced in `16.4.3`) [#​814](motdotla/dotenv#814) ### [`v16.4.4`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1644-2024-02-13) [Compare Source](motdotla/dotenv@v16.4.3...v16.4.4) ##### Changed - 🐞 Replaced chaining operator `?.` with old school `&&` (fixing node 12 failures) [#​812](motdotla/dotenv#812) ### [`v16.4.3`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1643-2024-02-12) [Compare Source](motdotla/dotenv@v16.4.2...v16.4.3) ##### Changed - Fixed processing of multiple files in `options.path` [#​805](motdotla/dotenv#805) ### [`v16.4.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1642-2024-02-10) [Compare Source](motdotla/dotenv@v16.4.1...v16.4.2) ##### Changed - Changed funding link in package.json to [`dotenvx.com`](https://dotenvx.com) ### [`v16.4.1`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1641-2024-01-24) [Compare Source](motdotla/dotenv@v16.4.0...v16.4.1) - Patch support for array as `path` option [#​797](motdotla/dotenv#797) ### [`v16.4.0`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1640-2024-01-23) [Compare Source](motdotla/dotenv@v16.3.2...v16.4.0) - Add `error.code` to error messages around `.env.vault` decryption handling [#​795](motdotla/dotenv#795) - Add ability to find `.env.vault` file when filename(s) passed as an array [#​784](motdotla/dotenv#784) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/External/card-drop/pulls/182 Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dotenv](https://github.com/motdotla/dotenv) | dependencies | patch | [`16.4.1` -> `16.4.5`](https://renovatebot.com/diffs/npm/dotenv/16.4.1/16.4.5) | --- ### Release Notes <details> <summary>motdotla/dotenv (dotenv)</summary> ### [`v16.4.5`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1645-2024-02-19) [Compare Source](motdotla/dotenv@v16.4.4...v16.4.5) ##### Changed - 🐞 fix recent regression when using `path` option. return to historical behavior: do not attempt to auto find `.env` if `path` set. (regression was introduced in `16.4.3`) [#​814](motdotla/dotenv#814) ### [`v16.4.4`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1644-2024-02-13) [Compare Source](motdotla/dotenv@v16.4.3...v16.4.4) ##### Changed - 🐞 Replaced chaining operator `?.` with old school `&&` (fixing node 12 failures) [#​812](motdotla/dotenv#812) ### [`v16.4.3`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1643-2024-02-12) [Compare Source](motdotla/dotenv@v16.4.2...v16.4.3) ##### Changed - Fixed processing of multiple files in `options.path` [#​805](motdotla/dotenv#805) ### [`v16.4.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1642-2024-02-10) [Compare Source](motdotla/dotenv@v16.4.1...v16.4.2) ##### Changed - Changed funding link in package.json to [`dotenvx.com`](https://dotenvx.com) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/411 Co-authored-by: Renovate Bot <renovate@vylpes.com> Co-committed-by: Renovate Bot <renovate@vylpes.com>
I cleaned up the code a bit to first gather a list of files (that exist) in a uniform way. The logic is as close as to what existed:
options.path
has one or more options use those..env
.The next step is to parse and combine those values - flattening them. The sequence would be:
existing env -> options.path[0] (if exists) -> options.path[1] -> etc
There were two choices here:
override
is set.existing env
honoring theoverride
flag.I went with (2) as I did not deem the
override
semantics made sense when collapsing multiple environment files - but let me know if you disagree.Also cleaned up the docs to reflect this.