Skip to content

Only parse the stdout from direnv export json#42

Merged
wbolster merged 3 commits intowbolster:masterfrom
stribb:issue41
May 11, 2019
Merged

Only parse the stdout from direnv export json#42
wbolster merged 3 commits intowbolster:masterfrom
stribb:issue41

Conversation

@stribb
Copy link
Collaborator

@stribb stribb commented May 3, 2019

Then, put stderr into *direnv*.

Side effect: exit code now only affects the warning message.

Tested:

Happy path: I ran (direnv--export "/Users/andstrib/somedir") and it returns a list of environment key/value cons pairs. *direnv* contained the output and a line from stderr.

Unhappy path: Then I changed the function to run direnv export this-does-not-work and re-ran it. It didn't parse the error message, but did write to *Messages* and *direnv*.

stribb and others added 3 commits May 3, 2019 11:56
Then, put stderr into *direnv*.

Side effect: exit code now only affects the warning message.
a normal message will not be visible when switching from a functional
direnv directory to another broken one (e.g. unapproved .envrc), since
the unloading of the first directory will be shown as a summary
instead, causing the problem to go unnoticed. instead, use (warn ...)
which will pop up a window instead.
@wbolster wbolster changed the title Only parse the stdout from direnv export json (#41) Only parse the stdout from direnv export json May 11, 2019
@wbolster wbolster merged commit b334a4a into wbolster:master May 11, 2019
@wbolster
Copy link
Owner

done in b334a4a:

Improve handling of direnv output (#42)

Only parse JSON from direnv stdout. Output on stderr still goes into the direnv buffer, but will never be parsed.

When a problem occurs, emit a warning, since a normal message will not be visible. An example scenario is switching from a functional direnv directory to a broken one (e.g. unapproved .envrc). The unloading of the first directory will be shown as a summary message, and the message emitted about the problem will be overwritten and hence will go unnoticed. Instead, use (warn ...) which will pop up a window with more details instead.

Fixes #41.

@wbolster
Copy link
Owner

thanks @stribb!

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.

2 participants