mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 21:18:42 +00:00
Fix use of download_and_extract
in find_crate_cratesio
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
d2e688c4c2
commit
fb5f61559b
1 changed files with 4 additions and 3 deletions
|
@ -102,16 +102,17 @@ pub async fn fetch_crate_cratesio(
|
||||||
|
|
||||||
debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it");
|
debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it");
|
||||||
|
|
||||||
|
let crate_dir = format!("{name}-{version_name}");
|
||||||
|
let crate_path = temp_dir.join(&crate_dir);
|
||||||
|
|
||||||
download_and_extract(
|
download_and_extract(
|
||||||
Url::parse(&crate_url)?,
|
Url::parse(&crate_url)?,
|
||||||
PkgFmt::Tgz,
|
PkgFmt::Tgz,
|
||||||
&temp_dir,
|
&temp_dir,
|
||||||
Some([Path::new("Cargo.toml").into()]),
|
Some([Path::new(&crate_dir).join("Cargo.toml").into()]),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let crate_path = temp_dir.join(format!("{name}-{version_name}"));
|
|
||||||
|
|
||||||
// Return crate directory
|
// Return crate directory
|
||||||
Ok(crate_path)
|
Ok(crate_path)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue