fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set#451
Merged
1 commit merged intorelease-1.2from Sep 5, 2024
unknown repository
Merged
fix: dir no longer panics when HOME and XDG_CONFIG_HOME are not set#4511 commit merged intorelease-1.2from unknown repository
1 commit merged intorelease-1.2from
unknown repository
Conversation
…449) This PR addresses the issue #446 In this PR I: - I removed the `init()` function from `dir/path` - When `userConfigDir()` returns an error, instead of `panic(err)` I default to the current directory instead - Split `loadUserPath()` into two new functions used to setup and return the values for `UserConfigDir` and `UserLibexecDir` - Added additional unit tests for the two new functions and to test the default directory is used when `HOME` is set to `""` --------- Signed-off-by: Jason <jagoodse@microsoft.com> Signed-off-by: JasonTheDeveloper <jagoodse@microsoft.com> Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com> Co-authored-by: Shiwei Zhang <shizh@microsoft.com> Co-authored-by: Patrick Zheng <patrickzheng@microsoft.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## release-1.2 #451 +/- ##
===============================================
+ Coverage 81.21% 81.34% +0.12%
===============================================
Files 32 32
Lines 2279 2283 +4
===============================================
+ Hits 1851 1857 +6
+ Misses 299 298 -1
+ Partials 129 128 -1 ☔ View full report in Codecov by Sentry. |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is for
release-1.2branch only.This PR cherry picks the fix of issue #446 from main.
The fix:
init()function fromdir/pathuserConfigDir()returns an error, instead ofpanic(err), default to the current directory insteadloadUserPath()into two new functions used to setup and return the values forUserConfigDirandUserLibexecDirHOMEis set to""