Skip to content

Commit 39cb6bd

Browse files
committed
fix: uninstall casks and version bump
1 parent ef46c19 commit 39cb6bd

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-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.1.8"
3+
version = "0.1.9"
44
edition = "2021"
55

66
[dependencies]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ async fn main() -> Result<()> {
9595
self_update::self_update().await?;
9696
}
9797
Some(Commands::Uninstall { package }) => {
98-
package_manager::uninstall_package(&package).await?;
98+
package_manager::uninstall_package(&package, cli.cask).await?;
9999
}
100100
Some(Commands::Install { package }) => {
101101
// Parse package name and version

src/package_manager.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use anyhow::Result;
22
use colored::*;
33
use std::process::Command;
44

5-
pub async fn uninstall_package(name: &str) -> Result<()> {
5+
pub async fn uninstall_package(name: &str, is_cask: bool) -> Result<()> {
66
if !crate::homebrew::is_homebrew_installed().await {
77
anyhow::bail!("Homebrew is not installed");
88
}
99

1010
// First check if the package is installed
1111
let installed = Command::new(if cfg!(windows) { "brew.exe" } else { "brew" })
12-
.args(["list", "--versions", name])
12+
.args(["list", "--versions", name, if is_cask { "--cask" } else {""}])
1313
.output()?;
1414

1515
if !installed.status.success() || installed.stdout.is_empty() {
@@ -24,7 +24,7 @@ pub async fn uninstall_package(name: &str) -> Result<()> {
2424
println!("Uninstalling {}...", name.cyan());
2525

2626
let status = Command::new(if cfg!(windows) { "brew.exe" } else { "brew" })
27-
.args(["uninstall", name])
27+
.args(["uninstall", name, if is_cask { "--cask" } else {""}])
2828
.status()?;
2929

3030
if !status.success() {

0 commit comments

Comments
 (0)