Skip to content

Commit

Permalink
Fix: rm/uninstall not working when 'v' is missing for neovim versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
matdexir committed Jul 13, 2024
1 parent b1b335b commit 07aaeed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/handlers/uninstall_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use dialoguer::{
theme::ColorfulTheme,
Confirm, MultiSelect,
};
use regex::Regex;
use reqwest::Client;
use tokio::fs;
use tracing::{info, warn};
Expand Down Expand Up @@ -60,7 +61,13 @@ pub async fn start(version: Option<&str>, config: Config) -> Result<()> {
Err(error) => return Err(anyhow!(error)),
};

let path = downloads_dir.join(&version.non_parsed_string);
let version_regex = Regex::new(r"^[0-9]+\.[0-9]+\.[0-9]+$")?;
let path = if version_regex.is_match(&version.non_parsed_string) {
let intermediate = format!("v{}", &version.non_parsed_string);
downloads_dir.join(&intermediate)

Check failure on line 67 in src/handlers/uninstall_handler.rs

View workflow job for this annotation

GitHub Actions / clippy (ubuntu-latest)

the borrowed expression implements the required traits

Check failure on line 67 in src/handlers/uninstall_handler.rs

View workflow job for this annotation

GitHub Actions / clippy (macos-latest)

the borrowed expression implements the required traits
} else {
downloads_dir.join(&version.non_parsed_string)
};

fs::remove_dir_all(path).await?;
info!(
Expand Down

0 comments on commit 07aaeed

Please sign in to comment.