Skip to content
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

chore: adopt standardized configuration directories #18

Merged
merged 3 commits into from
Apr 2, 2023
Merged

chore: adopt standardized configuration directories #18

merged 3 commits into from
Apr 2, 2023

Conversation

jeroenhd
Copy link
Contributor

By following each platform's standard file paths, the user's home folder doesn't get cluttered with hidden files and moving configuration between systems becomes easier, as all config files are in one plcae.

This change will make the pgrok client use the ~/.pgrok/pgrok.yml file, if available, for backwards compatibility. If this file does not exist, this change will make pgrok try the standardised application configuration path as configured by the user's preferences.

What this standardised path is, depends on the user's operating system. The underlying library's documentation has details and examples for each operating system.

In summary, the defaults are as follows:

Platform Default directory
Linux $XDG_CONFIG_HOME/pgrok/pgrok.yml
macOS ~/Library/Application Support/pgrok/pgrok.yml
Windows %LOCALAPPDATA%\pgrok\pgrok.yml

For more information, I recommend the following links:

By following each platform's standard file paths, the user's home folder doesn't get cluttered with hidden files and moving configuration between systems becomes easier, as all config files are in one plcae.

This change will make the pgrok client use the ~/.pgrok/pgrok.yml file, if available, for backwards compatibility. If this file does not exist, this change will make pgrok try the standardised application configuration path as configured by the user's preferences.

What this standardised path is, depends on the user's operating system. [The underlying library's documentation](https://github.com/adrg/xdg/#xdg-base-directory) has details and examples for each operating system.

In summary, the defaults are as follows:

|Platform|Default directory                            |
|--------|---------------------------------------------|
|Linux   |$XDG_CONFIG_HOME/pgrok/pgrok.yml             |
|macOS   |~/Library/Application Support/pgrok/pgrok.yml|
|Windows |%LOCALAPPDATA%\pgrok\pgrok.yml               |
@jeroenhd jeroenhd requested a review from unknwon as a code owner April 1, 2023 03:56
Copy link
Member

@unknwon unknwon 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!

@unknwon unknwon changed the title Use standardised configuration directories, if available. chore: adopt standardized configuration directories Apr 2, 2023
@unknwon unknwon merged commit f4c6912 into pgrok:main Apr 2, 2023
5 checks passed
@unknwon
Copy link
Member

unknwon commented Apr 2, 2023

https://github.com/pgrok/pgrok/releases/tag/v1.3.2 has been released for this merge.

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.

None yet

3 participants