Refactor: Extract new crate binstalk-{signal, downloader} (#518)

* Refactor: Extract new crate binstalk-downloader
* Re-export `PkgFmt` from `binstalk_manifests`
* Update release-pr.yml
* Update dependabot

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-11 15:02:54 +11:00 committed by GitHub
parent 3841762a5b
commit 89fa5b1769
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 456 additions and 260 deletions

View file

@ -10,6 +10,7 @@ use crate::{
helpers::{
download::Download,
remote::{Client, Url},
signal::wait_on_cancellation_signal,
},
manifests::cargo_toml_binstall::{Meta, TarBasedFmt},
};
@ -53,7 +54,11 @@ pub async fn fetch_crate_cratesio(
let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into();
Download::new(client, Url::parse(&crate_url)?)
.and_visit_tar(TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path))
.await
Ok(Download::new(client, Url::parse(&crate_url)?)
.and_visit_tar(
TarBasedFmt::Tgz,
ManifestVisitor::new(manifest_dir_path),
Some(Box::pin(wait_on_cancellation_signal())),
)
.await?)
}