Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use exec method for direnv #26

Merged
merged 1 commit into from
Jan 28, 2023
Merged

use exec method for direnv #26

merged 1 commit into from
Jan 28, 2023

Conversation

jdx
Copy link
Owner

@jdx jdx commented Jan 28, 2023

There are 2 ways to get direnv to read config, either by writing to a file with source_env or calling direnv dump. I think this one (direnv dump) is a bit cleaner since we don't need to write to a file. It's just a matter of setting environment variables when calling a subprocess.

I also like that this doesn't show an extra line of output when direnv loads. This is a before/after:

source_env

❯ touch .envrc
direnv: loading ~/src/rtx/.envrc
direnv: using rtx
direnv: loading /var/folders/m0/5_ttfcld3sx4sp34bw240qbc0000gn/T/rtx/direnv/ba9cf81aecd9bc74.envrc
direnv: export +RUBYLIB ~PATH

direnv dump

❯ touch .envrc
direnv: loading ~/src/rtx/.envrc
direnv: using rtx
direnv: export +RUBYLIB ~PATH

@jdx
Copy link
Owner Author

jdx commented Jan 28, 2023

Codecov Report

Base: 82.52% // Head: 83.18% // Increases project coverage by +0.66% 🎉

Coverage data is based on head (e469c95) compared to base (cfa2ca6).
Patch coverage: 96.55% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   82.52%   83.18%   +0.66%     
==========================================
  Files          67       68       +1     
  Lines        2054     2076      +22     
==========================================
+ Hits         1695     1727      +32     
+ Misses        359      349      -10     
Impacted Files Coverage Δ
src/cli/activate.rs 100.00% <ø> (ø)
src/cli/alias/ls.rs 85.71% <ø> (ø)
src/cli/asdf.rs 65.38% <ø> (ø)
src/cli/current.rs 100.00% <ø> (ø)
src/cli/deactivate.rs 100.00% <ø> (ø)
src/cli/direnv/activate.rs 0.00% <ø> (ø)
src/cli/env.rs 100.00% <ø> (ø)
src/cli/exec.rs 74.07% <ø> (+3.70%) ⬆️
src/cli/global.rs 100.00% <ø> (ø)
src/cli/latest.rs 100.00% <ø> (ø)
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jdx jdx force-pushed the direnv branch 12 times, most recently from 71c6efa to 321a21c Compare January 28, 2023 11:56
@jdx jdx merged commit 81b3b57 into main Jan 28, 2023
@jdx jdx deleted the direnv branch January 28, 2023 12:29
jdx pushed a commit that referenced this pull request Jun 1, 2024
Add missing word in docs
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