fix: force index refresh on install, fetch once for multi-package installs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7a17fcaa93
commit
a4ea036a7c
1 changed files with 3 additions and 3 deletions
|
|
@ -63,8 +63,9 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
match cli.command {
|
match cli.command {
|
||||||
Cmd::Install { packages } => {
|
Cmd::Install { packages } => {
|
||||||
|
let index = manifest::load(true)?;
|
||||||
for pkg in &packages {
|
for pkg in &packages {
|
||||||
cmd_install(pkg, &bin_dir)?;
|
cmd_install(&index, pkg, &bin_dir)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -76,8 +77,7 @@ fn main() -> Result<()> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cmd_install(name: &str, bin_dir: &std::path::Path) -> Result<()> {
|
fn cmd_install(index: &manifest::Index, name: &str, bin_dir: &std::path::Path) -> Result<()> {
|
||||||
let index = manifest::load(false)?;
|
|
||||||
let pkg = index
|
let pkg = index
|
||||||
.get(name)
|
.get(name)
|
||||||
.ok_or_else(|| anyhow::anyhow!("unknown package: {name}"))?;
|
.ok_or_else(|| anyhow::anyhow!("unknown package: {name}"))?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue