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

fix env on directory change #13

Merged
merged 1 commit into from
Jan 27, 2023
Merged

fix env on directory change #13

merged 1 commit into from
Jan 27, 2023

Conversation

jdx
Copy link
Owner

@jdx jdx commented Jan 27, 2023

Fixes #12

There are actually like 3 bugs that prevented this from working right. It wasn't overwriting env vars when the value changed (only new values), it also wasn't using the pristine environment from hook-env. This is a problem since the go plugin actually checks to see if GOPATH is already set, if so, it doesn't modify it. So we need to clear out GOPATH iff we set it previously.

@jdx
Copy link
Owner Author

jdx commented Jan 27, 2023

Codecov Report

Base: 80.24% // Head: 81.73% // Increases project coverage by +1.48% 🎉

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

❗ Current head e358f0c differs from pull request most recent head f592e73. Consider uploading reports for the commit f592e73 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #13      +/-   ##
==========================================
+ Coverage   80.24%   81.73%   +1.48%     
==========================================
  Files          59       59              
  Lines        1853     1872      +19     
==========================================
+ Hits         1487     1530      +43     
+ Misses        366      342      -24     
Impacted Files Coverage Δ
src/cli/env.rs 100.00% <ø> (ø)
src/hook_env.rs 66.66% <46.15%> (-7.62%) ⬇️
src/env.rs 80.43% <60.00%> (+1.48%) ⬆️
src/cli/hook_env.rs 94.44% <100.00%> (+10.44%) ⬆️
src/config/config_file/tool_versions.rs 93.65% <100.00%> (+0.10%) ⬆️
src/env_diff.rs 100.00% <100.00%> (+2.22%) ⬆️
src/runtimes.rs 73.07% <100.00%> (+4.89%) ⬆️
src/shorthand_repository.rs 100.00% <0.00%> (ø)
src/config/mod.rs 84.51% <0.00%> (+1.93%) ⬆️
... and 3 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 merged commit beeea50 into main Jan 27, 2023
@jdx jdx deleted the fix-env branch January 27, 2023 19:47
jdx pushed a commit that referenced this pull request Apr 9, 2024
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.

GOROOT not set/updated on directory change
1 participant