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

generate-config writes to hardcoded path #26

Closed
jonassmedegaard opened this issue Jul 23, 2023 · 2 comments
Closed

generate-config writes to hardcoded path #26

jonassmedegaard opened this issue Jul 23, 2023 · 2 comments

Comments

@jonassmedegaard
Copy link

jonassmedegaard commented Jul 23, 2023

I think it would be better if subcommand generate-config would not create default config file, but simply spew config data to stdout. That way, the user is free to either create default or custom config file, or to use the output to make a diff against an existing config file.

Additionally, I think it would be better if a) instead of a hardcoded default path XDG evironment variables was consulted (which leads to same default path as now, so no surprises for the millions of existing users of the tool), and b) not only a user-specific path is used but (when that is missing) system-shared paths are consulted too.
All of this seems possible with the crate microxdg using Xdg::search_config_file().
(the more popular crate Directories unfortunately does not support system-wide lookups).

@bensadeh
Copy link
Owner

Thanks for posting this issue. XDG support is planned and coming.

To accommodate for more options for the config, the config command will take arguments and look something like this in the future:

spin config --generate
spin config --print-default

@bensadeh
Copy link
Owner

In 1.2.0 there are now two flags that more explicitly state what is happening:

--create-default-config  Generate a new configuration file
--show-default-config    Print the default configuration 

Moreover, if XDG_CONFIG_HOME is set, it will be used for both creating and reading from config.

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

No branches or pull requests

2 participants