feat: multi-package install and bakery update all
Some checks failed
release / build (push) Failing after 32s
Some checks failed
release / build (push) Failing after 32s
- bakery install now accepts one or more package names - bakery update all treated as update-everything (same as bare update) - bump version to 0.2.0 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5edb5bae31
commit
b97882e715
3 changed files with 14 additions and 7 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
|
@ -81,7 +81,7 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bakery"
|
name = "bakery"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|
@ -118,7 +118,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bread-theme"
|
name = "bread-theme"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dirs",
|
"dirs",
|
||||||
"gtk4",
|
"gtk4",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ members = ["bakery", "bread-theme"]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["Breadway <rileyhorsham@gmail.com>"]
|
authors = ["Breadway <rileyhorsham@gmail.com>"]
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,10 @@ struct Cli {
|
||||||
|
|
||||||
#[derive(Subcommand)]
|
#[derive(Subcommand)]
|
||||||
enum Cmd {
|
enum Cmd {
|
||||||
/// Install a package
|
/// Install one or more packages
|
||||||
Install {
|
Install {
|
||||||
package: String,
|
#[arg(required = true, num_args = 1..)]
|
||||||
|
packages: Vec<String>,
|
||||||
},
|
},
|
||||||
/// Remove an installed package (data files are never deleted)
|
/// Remove an installed package (data files are never deleted)
|
||||||
Remove {
|
Remove {
|
||||||
|
|
@ -61,7 +62,12 @@ fn main() -> Result<()> {
|
||||||
let bin_dir = cli.bin_dir.unwrap_or_else(default_bin_dir);
|
let bin_dir = cli.bin_dir.unwrap_or_else(default_bin_dir);
|
||||||
|
|
||||||
match cli.command {
|
match cli.command {
|
||||||
Cmd::Install { package } => cmd_install(&package, &bin_dir),
|
Cmd::Install { packages } => {
|
||||||
|
for pkg in &packages {
|
||||||
|
cmd_install(pkg, &bin_dir)?;
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
Cmd::Remove { package } => cmd_remove(&package, &bin_dir),
|
Cmd::Remove { package } => cmd_remove(&package, &bin_dir),
|
||||||
Cmd::Update { package } => cmd_update(package.as_deref(), &bin_dir),
|
Cmd::Update { package } => cmd_update(package.as_deref(), &bin_dir),
|
||||||
Cmd::List { installed } => cmd_list(installed),
|
Cmd::List { installed } => cmd_list(installed),
|
||||||
|
|
@ -96,7 +102,8 @@ fn cmd_update(name: Option<&str>, bin_dir: &std::path::Path) -> Result<()> {
|
||||||
let index = manifest::load(true)?; // force refresh on update
|
let index = manifest::load(true)?; // force refresh on update
|
||||||
let state = state::State::load()?;
|
let state = state::State::load()?;
|
||||||
|
|
||||||
let targets: Vec<String> = match name {
|
let effective = name.filter(|&n| n != "all");
|
||||||
|
let targets: Vec<String> = match effective {
|
||||||
Some(n) => vec![n.to_string()],
|
Some(n) => vec![n.to_string()],
|
||||||
None => state.packages.keys().cloned().collect(),
|
None => state.packages.keys().cloned().collect(),
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue