mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-13 15:30:03 +00:00
Find best download source out of alternatives (format extension) (#236)
This commit is contained in:
parent
19266a4fb6
commit
adef01f3dd
7 changed files with 93 additions and 52 deletions
|
@ -32,17 +32,17 @@ impl super::Fetcher for QuickInstall {
|
|||
})
|
||||
}
|
||||
|
||||
async fn check(&self) -> Result<bool, BinstallError> {
|
||||
async fn find(&self) -> Result<bool, BinstallError> {
|
||||
let url = self.package_url();
|
||||
self.report();
|
||||
info!("Checking for package at: '{url}'");
|
||||
remote_exists(&self.client, Url::parse(&url)?, Method::HEAD).await
|
||||
remote_exists(self.client.clone(), Url::parse(&url)?, Method::HEAD).await
|
||||
}
|
||||
|
||||
async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> {
|
||||
let url = self.package_url();
|
||||
info!("Downloading package from: '{url}'");
|
||||
download_and_extract(&self.client, Url::parse(&url)?, self.pkg_fmt(), dst).await
|
||||
download_and_extract(&self.client, &Url::parse(&url)?, self.pkg_fmt(), dst).await
|
||||
}
|
||||
|
||||
fn pkg_fmt(&self) -> PkgFmt {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue