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

[RFC] Update the config with the new tool in the 'install' command #90

Open
3 tasks
chshersh opened this issue Sep 15, 2022 · 2 comments
Open
3 tasks
Labels
config TOML configuration, config-related CLI options enhancement New feature or request hacktoberfest https://hacktoberfest.com/
Milestone

Comments

@chshersh
Copy link
Owner

The install command just installs the tool. It would be nice if it also updates the config, so the future tool sync calls would sync the tool.

The behaviour should be following:

  • Check if the tool is already in config
  • If not, add it to the end of the configuration file
  • Write an information message saying that the configuration file was updated

Alternative

Possible two behaviours:

  • This is done under the flag --update-config for the install command and the default is to not update the config
  • This is done by default and can be disabled with the --no-update-config flag

I'm not sure which default is better here 🤔 Maybe the one that doesn't change the config? Or maybe people actually want this behaviour out-of-the-box?

The feature is inspired by this comment:

@chshersh chshersh added enhancement New feature or request config TOML configuration, config-related CLI options labels Sep 15, 2022
@MitchellBerend
Copy link
Collaborator

We could also add a prompt for the user along side one of these options if no flag is provided? That way there is no default that can mess up the config.

@chshersh
Copy link
Owner Author

I'm leaning towards the --update-config option for two reasons:

  1. According to CLI Guidelines, tools shouldn't mutate user-facing files unless specified explicitly.
  2. One possible use case for the tool install xyz is to install a tool, play with it locally and decide whether you actually want it or not. So you may not want to add it to the config by default but decide later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config TOML configuration, config-related CLI options enhancement New feature or request hacktoberfest https://hacktoberfest.com/
Projects
None yet
Development

No branches or pull requests

2 participants