Refactor: Create new crate binstalk-git-repo-api

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-05-05 23:44:19 +10:00
parent dfdaf6952e
commit 9efe39528f
No known key found for this signature in database
GPG key ID: 76D1E687CA3C4928
17 changed files with 262 additions and 34 deletions

View file

@ -11,9 +11,8 @@ license = "GPL-3.0-only"
[dependencies]
binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" }
binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [
"gh-api-client",
] }
binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false }
binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" }
binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = [
"quickinstall",
] }

View file

@ -4,9 +4,7 @@ use std::{
process::{ExitCode, ExitStatus, Termination},
};
use binstalk_downloader::{
download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError,
};
use binstalk_downloader::{download::DownloadError, remote::Error as RemoteError};
use binstalk_fetchers::FetchError;
use compact_str::CompactString;
use itertools::Itertools;
@ -19,7 +17,8 @@ use tracing::{error, warn};
use crate::{
bins,
helpers::{
cargo_toml::Error as CargoTomlError, cargo_toml_workspace::Error as LoadManifestFromWSError,
cargo_toml::Error as CargoTomlError,
cargo_toml_workspace::Error as LoadManifestFromWSError, gh_api_client::GhApiError,
},
registry::{InvalidRegistryError, RegistryError},
};

View file

@ -4,7 +4,7 @@ pub(crate) mod target_triple;
pub mod tasks;
pub(crate) use binstalk_downloader::download;
pub use binstalk_downloader::gh_api_client;
pub use binstalk_git_repo_api::gh_api_client;
pub(crate) use cargo_toml_workspace::{self, cargo_toml};
#[cfg(feature = "git")]

View file

@ -1,13 +1,13 @@
pub use binstalk_downloader::remote::*;
pub use url::ParseError as UrlParseError;
use binstalk_downloader::gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact};
use std::sync::{
atomic::{AtomicBool, Ordering::Relaxed},
Once,
};
use tracing::{debug, warn};
use super::gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact};
use crate::errors::BinstallError;
/// This function returns a future where its size should be at most size of