Skip to content

Fix handling of missing command by dotenv run - #606

Merged
theskumar merged 2 commits into
theskumar:mainfrom
bbc2:run-fix-nx-command-error
Mar 2, 2026
Merged

Fix handling of missing command by dotenv run#606
theskumar merged 2 commits into
theskumar:mainfrom
bbc2:run-fix-nx-command-error

Conversation

@bbc2

@bbc2 bbc2 commented Jan 11, 2026

Copy link
Copy Markdown
Collaborator

Changes for users:

  • (BREAKING) dotenv run exits with status code 1 instead of 2 if the command provided as argument can't be found.
  • dotenv run prints a friendly error message instead of a stack trace if the command provided as argument can't be found.

Notes:

The existing test case was wrongly testing for that situation: it was actually observing a "missing env file" error, not a "command not found error". I thus added an appropriate test case for full coverage.

This should ideally be rebased on top of and merged after #604 to benefit from automated testing on Windows.

Changes for users:

- (BREAKING) `dotenv run` exits with status code 1 instead of 2 if the command
  provided as argument can't be found.
- `dotenv run` prints a friendly error message instead of a stack trace
  if the command provided as argument can't be found.

Notes:

The existing test case was wrongly testing for that situation: it was
actually observing a "missing env file" error, not a "command not found
error". I thus added an appropriate test case for full coverage.
@bbc2
bbc2 force-pushed the run-fix-nx-command-error branch from 2fef1da to ceeb066 Compare January 17, 2026 11:59
* main:
  Remove the use of `sh` in tests (theskumar#612)

# Conflicts:
#	tests/test_cli.py
@theskumar
theskumar merged commit da0c820 into theskumar:main Mar 2, 2026
9 checks passed
theskumar added a commit that referenced this pull request Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants