-
-
Notifications
You must be signed in to change notification settings - Fork 11
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: read credentials.ini from XDG_CONFIG_HOME (or os equivalents) in addition to bin directory #103
feat: read credentials.ini from XDG_CONFIG_HOME (or os equivalents) in addition to bin directory #103
Conversation
… addition to bin directory
"linux people", as you put it, are definitely welcome here 😄 I'll try to give it a try today! Thanks for the PR! |
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.
Looking good! And the new dependency seems super useful too!
cheers - I've added a few replies, haven't had much time to look at it this week but will make some updates hopefully over the weekend happy to give the config population a go if you want unless you want to (no hard feelings either way) I feel like like I said in my replies - I'm cautious about making sweeping changes as a first time PR on the project :) |
Merging now, if we want some additional changes we can always ship them on a future release! Thank you for your help! |
📑 Description
Maybe it's just linux people but I'm not a fan of having configuration files in the same folder as the binary (as I installed in ~/.local/bin)
Each OS has its own 'assigned' configuration directory:
$XDG_CONFIG_HOME
or$HOME
/.config$HOME
/Library/Application Support{FOLDERID_LocalAppData}
Ideally the credentials.ini file would be managed by the cli tool and placed there, rather than the user doing it themselves, however I thought I'd keep the changes small.
I don't have a mac to test this on and haven't on windows yet (just linux)
✅ Checks
ℹ Additional Information
Note: I've only done a tiny bit of rust, apologies for any noobiness :)
Showing the error with multiple locations
Reading credentialas from bin directory (current behaviour)
Reading credentials from XDG_CONFIG_HOME and equivalents
It may be worth having additional support specifically for scoop now that I think of it, as that has a dedicated
persist
folder for config - something like%USERPROFILE%/scoop/persist/discrakt/credentials.ini
- I see credentials.ini is configured to persist, not sure how that works with the current relative directory stuff though