chshersh / tool-sync

🧰 Download pre-built binaries of all your favourite tools with a single command
https://crates.io/crates/tool-sync
Mozilla Public License 2.0
69 stars 16 forks source link

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

Open chshersh opened 1 year ago

chshersh commented 1 year ago

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:

Alternative

Possible two behaviours:

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:

MitchellBerend commented 1 year ago

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 commented 1 year ago

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.