config: allow overriding data directory via GH_DATA_DIR
#209
+57
−8
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.
Hey, this is a bit of a drive-by PR but I think it's quite small in nature and fills in a gap that'd help with consistency. I've added support for overriding the data directory via a
GH_DATA_DIRenvironment variable, which is akin toGH_CONFIG_DIR. This is nice for users who want a global/user-agnostic configuration, and don't want to pollute their home dirs. In my case, I want to manage extensions in a different directory than the default (I use NixOS and want to have my config be read-only in/etc/gh).The precedence for locating the data dir is now
GH_DATA_DIR-->XDG_DATA_HOME-->LocalAppData(Windows) -->HOMEWhile I was at it, I also fixed tests that suffered from environment pollution. I set
GH_TOKENand this was breaking some tests.Thanks a ton!
N.B. If accepted, I can help update the main CLI repo with docs :)