Skip to content

Commit

Permalink
feat: self update and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelessiet committed Nov 18, 2024
1 parent bd59bcc commit 5a25a9f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bert"
version = "0.1.5"
version = "0.1.6"
edition = "2021"

[dependencies]
Expand Down
12 changes: 6 additions & 6 deletions src/homebrew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ pub struct Formula {
#[derive(Debug, Deserialize, Clone)]
pub struct Cask {
pub token: String, // name of the cask
pub name: Vec<String>,
// pub name: Vec<String>,
pub desc: Option<String>,
pub homepage: Option<String>,
pub version: String,
pub url: Option<String>,
// pub url: Option<String>,
pub tap: Option<String>,
}

#[derive(Debug, Deserialize, Clone)]
pub struct Versions {
#[serde(default)]
pub stable: String,
pub head: String,
pub bottle: bool,
// pub head: String,
// pub bottle: bool,
}

impl Formula {
Expand Down Expand Up @@ -371,8 +371,8 @@ pub async fn search_formula(
homepage: cask.homepage,
versions: Versions {
stable: cask.version,
head: "".to_string(),
bottle: false,
// head: "".to_string(),
// bottle: false,
},
versioned_formulae: vec![],
aliases: vec![],
Expand Down
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ mod command_handler;
mod homebrew;
mod package_manager;
mod platform;
mod self_update;

#[derive(Parser)]
#[command(
name = "bert",
author = "Michael Essiet <[email protected]>",
version = "0.1.5",
version = "0.1.6",
about = "A friendly cross-platform package assistant built on top of Homebrew",
long_about = "Bert 🐕 is a friendly package assistant that leverages Homebrew's package repository to provide \
cross-platform package management. He automatically handles installation of missing \
Expand Down Expand Up @@ -57,6 +58,8 @@ enum Commands {
},
/// List installed packages
List,
/// Update bert to the latest version
SelfUpdate,
}
#[tokio::main]
async fn main() -> Result<()> {
Expand All @@ -67,6 +70,9 @@ async fn main() -> Result<()> {
let cli = Cli::parse();

match cli.command {
Some(Commands::SelfUpdate) => {
self_update::self_update().await?;
}
Some(Commands::Uninstall { package }) => {
package_manager::uninstall_package(&package).await?;
}
Expand Down

0 comments on commit 5a25a9f

Please sign in to comment.