-
Notifications
You must be signed in to change notification settings - Fork 42
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: dir no longer panics when HOME and XDG_CONFIG_HOME are not set #451
Conversation
…otaryproject#449) This PR addresses the issue notaryproject#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 <[email protected]> Signed-off-by: JasonTheDeveloper <[email protected]> Signed-off-by: Patrick Zheng <[email protected]> Co-authored-by: Shiwei Zhang <[email protected]> Co-authored-by: Patrick Zheng <[email protected]>
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR is for
release-1.2
branch only.This PR cherry picks the fix of issue #446 from main.
The fix:
init()
function fromdir/path
userConfigDir()
returns an error, instead ofpanic(err)
, default to the current directory insteadloadUserPath()
into two new functions used to setup and return the values forUserConfigDir
andUserLibexecDir
HOME
is set to""