-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: support XDG_CONFIG_HOME for receipts #171
Conversation
573f1e2
to
698cb92
Compare
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.
hmm this isn't quite right
- if we see XDG_CONFIG_HOME in env we should always check it regardless of platform
- we need to try to load a receipt from every valid location for the platform, using the first successful one
4dbc6bb
to
a21ae0a
Compare
We now check multiple receipt paths, including XDG_CONFIG_HOME. We load a receipt from the first path which contains a receipt file, ensuring we're able to manage the absence of a receipt in that path if that environment variable is set.
a21ae0a
to
81ffaaf
Compare
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.
This looks good to me.
I was going to suggest a test, but thinking about it a bit more, I think any test would basically be writing the exact logic a second time — and "this if/else if/else
statement executes as the language says it should" is pretty much the same as assert!(true) // make sure booleans work
. 😅
b9726ce
to
768bf0b
Compare
768bf0b
to
4de5474
Compare
Ended up finding a real test I could write, so I've confirmed that this works as expected. |
refs axodotdev/cargo-dist#1355.
We'll need to make sure we ship the cargo-dist side as well when shipping this, so we don't get a mismatch in expectations.
An open question on this and the other PR: is it appropriate for us to respect this on both Linux and Mac? I'm assuming yes.
cc @brennanfee