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

Use XDG Base Directory Spec for locating config files instead of current dir #144

Open
samlaf opened this issue Dec 12, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@samlaf
Copy link

samlaf commented Dec 12, 2024

Is your feature request related to a problem? Please describe.

Right now devnet init creates a devnet.yaml file in the current directory, which is not very ideal since:

  1. I should be able to use the cli irrespective of my current directory
  2. This would lead to clutter all over my filesystem if I am not careful

Describe the solution you'd like

I would recommend using https://specifications.freedesktop.org/basedir-spec/latest/index.html which is a standard to place config/cache/data for different apps/clis.

$XDG_CONFIG_HOME/yourapp/config.yaml  (defaults to ~/.config/yourapp/)
$XDG_DATA_HOME/yourapp/              (defaults to ~/.local/share/yourapp/)
$XDG_CACHE_HOME/yourapp/             (defaults to ~/.cache/yourapp/)

There's even a golang package available to deal with this spec: https://github.com/adrg/xdg

Describe alternatives you've considered

Additional context

@samlaf samlaf added the enhancement New feature or request label Dec 12, 2024
@MegaRedHand
Copy link
Collaborator

We expect projects to commit these config files to their repositories, like Makefiles, Dockerfiles, or plain bash scripts (configuration might be a misnomer since they are more like specifications). Storing them inside a devnet config dir would make this more difficult for users.

This info is undoubtedly useful, though. Thanks for sharing!

@samlaf
Copy link
Author

samlaf commented Dec 13, 2024

@MegaRedHand i see that makes sense! Would be valuable info to add to the top of the readme I feel. Point to a repo example that was built with the CLI, and add “init” steps to create a new one with best practice recommendations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants