Skip to content

Configuration path can come from environment.#2444

Merged
samcoe merged 2 commits intocli:trunkfrom
bigkevmcd:config-dir-from-env
Jan 25, 2021
Merged

Configuration path can come from environment.#2444
samcoe merged 2 commits intocli:trunkfrom
bigkevmcd:config-dir-from-env

Conversation

@bigkevmcd
Copy link
Contributor

This adds support for using the GH_CONFIG_DIR environment variable to determine
where the config files are written, this is useful for cases where the homedir
is not writable.

Copy link
Contributor

@vilmibm vilmibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this! I agree that this is useful and I believe the reason we don't yet support it is because we intended to respect XDG_CONFIG_HOME and XDG_DATA_HOME for our config and hosts files.

It's been a long time since the conversation in #554 and I'd like us to resume it now that more has happened to our configuration system.

Until then, this PR can hang out. It might be the case that we don't want to pretend to adhere to the XDG spec if our files don't actually qualify as pure config files; in that case, an ad-hoc variable like this might be the way to go.

Thanks for patience.

@bigkevmcd
Copy link
Contributor Author

I'd be happy to rework to use XDG_CONFIG_HOME and XDG_DATA_HOME.

@mislav mislav mentioned this pull request Nov 24, 2020
8 tasks
@vilmibm
Copy link
Contributor

vilmibm commented Jan 20, 2021

@samcoe this looks good and just needs a review / conflict cleanup to ensure every use of the path is updated 👍

Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cleaned this up a bit by removing the final places where ~/.config/gh was hardcoded and fixed up the tests. I think this is good to go now 👍

bigkevmcd and others added 2 commits January 25, 2021 10:07
This adds support for using the GH_CONFIG_DIR environment variable to determine
where the config files are written, this is useful for cases where the homedir
is not writable.
@samcoe samcoe merged commit e6e9208 into cli:trunk Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants