Repository navigation
src: read env files only from Node.js options - #67642
Open
ShogunPanda wants to merge 1 commit into
Open
ShogunPanda wants to merge 1 commit into
ShogunPanda wants to merge 1 commit into
Conversation
Collaborator
|
Review requested:
|
`--env-file` and `--env-file-if-exists` were looked up in every argument up to a literal `--`, including the ones that follow the script name. Those belong to the script, but the files they named were still opened and their `NODE_OPTIONS` applied. Find where the options of Node.js end with a throwaway parse and only look for env file flags before that point. The parse is shared with the config file reader and only runs when an env file flag is present. Assisted-By: OpenAI GPT-5.6 Sol <openai/gpt-5.6-sol> Signed-off-by: Paolo Insogna <paolo@cowtech.it>
ShogunPanda
force-pushed
the
cli-env-file-before-script
branch
from
November 20, 2026 09:01
65a1557 to
20d5f8e
Compare
Contributor
|
The
notable-change
Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67642 +/- ##
=======================================
Coverage 90.71% 90.72%
=======================================
Files 801 801
Lines 280906 280913 +7
Branches 54246 54249 +3
=======================================
+ Hits 254834 254856 +22
+ Misses 16251 16249 -2
+ Partials 9821 9808 -13
🚀 New features to boost your workflow:
|
marco-ippolito
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--env-fileand--env-file-if-existswere looked up in every argument up to a literal--, including the ones after the script name. Those arguments belong to the script, but the files they named were still opened and theirNODE_OPTIONSapplied.Find where the options of Node.js end with a throwaway parse, the same way
--config-fileis handled, and only look for env file flags before that point.Testing: added
test/parallel/test-dotenv-args-after-script.js. Thetest-dotenv*,test-cli-*andtest-config-file*suites pass, as do eslint and cpplint.