Skip to content

Commit e23c4b9

Browse files
committed
fix: uninstall issues
1 parent 6398a1c commit e23c4b9

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bert"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
edition = "2021"
55

66
[dependencies]

src/homebrew.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,17 @@ pub async fn uninstall_formula(name: &str, is_cask: bool) -> Result<()> {
430430
let version = String::from_utf8_lossy(&installed.stdout);
431431
println!("Found installed package: {}", version.trim());
432432

433-
println!("Uninstalling {}...", name.cyan());
433+
println!("Uninstalling {} 🐕", name.cyan());
434434

435-
let status = Command::new(if cfg!(windows) { "brew.exe" } else { "brew" })
436-
.args(["uninstall", name, if is_cask { "--cask" } else { "" }])
437-
.status()?;
435+
let status = if is_cask {
436+
Command::new(if cfg!(windows) { "brew.exe" } else { "brew" })
437+
.args(["uninstall", "--cask", name])
438+
.status()?
439+
} else {
440+
Command::new(if cfg!(windows) { "brew.exe" } else { "brew" })
441+
.args(["uninstall", name])
442+
.status()?
443+
};
438444

439445
if !status.success() {
440446
anyhow::bail!("Failed to uninstall {}", name);

0 commit comments

Comments
 (0)