Skip to content

fix(cli): send debug diagnostics to stderr - #1081

Open
wozhenbang2004 wants to merge 3 commits into
motdotla:masterfrom
wozhenbang2004:fix/cli-debug-stderr
Open

wozhenbang2004 wants to merge 3 commits into
motdotla:masterfrom
wozhenbang2004:fix/cli-debug-stderr

Conversation

@wozhenbang2004

Copy link
Copy Markdown

With --debug, dotenv run can write its own file-loading and variable-conflict diagnostics to the child command's stdout. Consumers parsing that output as JSON receive diagnostic text before the JSON.

Send the CLI diagnostics to stderr and preserve the library logger defaults. The regressions cover a missing default .env file and an environment variable that is already set. Both fail on the unmodified CLI.

npm test completed with 1,424 assertions passed and one Windows-only test skipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant