MordechaiHadad / bob

A version manager for neovim
MIT License
1.41k stars 36 forks source link

[Feature] calling bob update without parameters should update the currently used version #214

Closed icholy closed 3 months ago

icholy commented 3 months ago

It would be nice if I could call bob update without any additional parameters to update the currently used version. Something like:

diff --git a/src/cli.rs b/src/cli.rs
index 88c597f..79f1389 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -147,7 +147,9 @@ pub async fn start(config: Config) -> Result<()> {
             if data.version.is_some() || data.all {
                 update_handler::start(data, &client, config).await?;
             } else {
-                error!("Please provide a version or use the --all flag");
+                let current = get_current_version(&config).await?;
+                let mut parsed = super::version::parse_version_type(&client, &current).await?;
+                install_handler::start(&mut parsed, &client, &config).await?;
             }
         }
     }
MordechaiHadad commented 3 months ago

@icholy pushed a new PR with this feature, could you test it? Simply run update without the all flag

icholy commented 3 months ago

@MordechaiHadad It's working for me.