watch: fix --env-file-if-exists crashing on linux if the file is missing#61870
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61870 +/- ##
==========================================
- Coverage 89.72% 89.66% -0.06%
==========================================
Files 675 676 +1
Lines 204806 206347 +1541
Branches 39355 39534 +179
==========================================
+ Hits 183761 185021 +1260
- Misses 13330 13458 +128
- Partials 7715 7868 +153
🚀 New features to boost your workflow:
|
|
@anonrig I've addressed all comments. I've also documented the change in Also, thanks a lot for the quick and detailed feedback! |
Commit Queue failed- Loading data for nodejs/node/pull/61870 ✔ Done loading data for nodejs/node/pull/61870 ----------------------------------- PR info ------------------------------------ Title watch: fix --env-file-if-exists crashing on linux if the file is missing (#61870) ⚠ Could not retrieve the email or name of the PR author's from user's GitHub profile! Branch efekrskl:fix/watch-mode-optional-env-crash -> nodejs:main Labels author ready, needs-ci, watch-mode Commits 9 - watch: fix --env-file-if-exists crashing on linux if the file is missing - watch: try/catch instead of existsSync - watch: js-lint-fix - feat: dont throw on ENOENT if allowMissing is set - fix: add default val to throwIfNoEntry - feat: make options an object - doc, test: add throwIfNoEntry docs and test - fix: check falsy instead of explicit check - test: apply review changes Committers 1 - Efe Karasakal <dogukankrskl@gmail.com> PR-URL: https://github.com/nodejs/node/pull/61870 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/61870 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> -------------------------------------------------------------------------------- ℹ This PR was created on Tue, 17 Feb 2026 21:30:31 GMT ✔ Approvals: 3 ✔ - Antoine du Hamel (@aduh95) (TSC): https://github.com/nodejs/node/pull/61870#pullrequestreview-3917705316 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/61870#pullrequestreview-3919203863 ✔ - Moshe Atlow (@MoLow): https://github.com/nodejs/node/pull/61870#pullrequestreview-4089850384 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2026-04-10T20:04:24Z: https://ci.nodejs.org/job/node-test-pull-request/72612/ - Querying data for job/node-test-pull-request/72612/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 61870 From https://github.com/nodejs/node * branch refs/pull/61870/merge -> FETCH_HEAD ✔ Fetched commits as 4dc18ef29d2a..7feebe6256fa -------------------------------------------------------------------------------- [main d9f9b8b4e8] watch: fix --env-file-if-exists crashing on linux if the file is missing Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Tue Feb 17 20:19:51 2026 +0100 2 files changed, 32 insertions(+), 4 deletions(-) [main a13f6aeb8c] watch: try/catch instead of existsSync Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Wed Feb 18 17:03:30 2026 +0100 1 file changed, 22 insertions(+), 17 deletions(-) [main dec9c6ced5] watch: js-lint-fix Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Wed Feb 18 18:44:20 2026 +0100 1 file changed, 12 insertions(+), 12 deletions(-) Auto-merging lib/fs.js [main 0221cf2a03] feat: dont throw on ENOENT if allowMissing is set Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Thu Feb 19 20:34:56 2026 +0100 5 files changed, 24 insertions(+), 21 deletions(-) [main d709e640f9] fix: add default val to throwIfNoEntry Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Thu Feb 19 22:28:53 2026 +0100 1 file changed, 4 insertions(+), 2 deletions(-) [main 1246dacc35] feat: make options an object Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Thu Feb 19 22:52:02 2026 +0100 3 files changed, 12 insertions(+), 8 deletions(-) Auto-merging doc/api/fs.md [main 8b6be4b1d8] doc, test: add throwIfNoEntry docs and test Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Thu Feb 19 23:26:10 2026 +0100 2 files changed, 28 insertions(+) [main 92e05e2a8d] fix: check falsy instead of explicit check Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Wed Mar 4 17:58:57 2026 +0100 1 file changed, 1 insertion(+), 1 deletion(-) [main 35f914bf86] test: apply review changes Author: Efe Karasakal <dogukankrskl@gmail.com> Date: Wed Mar 4 19:16:36 2026 +0100 1 file changed, 5 insertions(+), 5 deletions(-) ✔ Patches applied There are 9 commits in the PR. Attempting autorebase. (node:355) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created) Rebasing (2/18) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- watch: fix --env-file-if-exists crashing on linux if the file is missinghttps://github.com/nodejs/node/actions/runs/24264942111 |
|
Landed in 726b220 |
Fixes #57040
--env-file-if-exists combined with --watch seems to crash in if the .env file is missing (in Linux), this PR aims to fix that.