feat: Support install directly from git repo (#1162)

Fixed #3

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-06-24 11:01:31 +10:00 committed by GitHub
parent dd35fba232
commit ca00cbaccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 1810 additions and 28 deletions

View file

@ -10,7 +10,9 @@ use tokio::{
use crate::{
fetchers::{Data, Fetcher, TargetData},
helpers::{gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client},
helpers::{
self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client,
},
manifests::cargo_toml_binstall::PkgOverride,
DesiredTargets,
};
@ -19,6 +21,13 @@ pub mod resolve;
pub type Resolver = fn(Client, GhApiClient, Arc<Data>, Arc<TargetData>) -> Arc<dyn Fetcher>;
#[non_exhaustive]
pub enum CargoTomlFetchOverride {
#[cfg(feature = "git")]
Git(helpers::git::GitUrl),
Path(PathBuf),
}
pub struct Options {
pub no_symlinks: bool,
pub dry_run: bool,
@ -28,7 +37,7 @@ pub struct Options {
pub no_track: bool,
pub version_req: Option<VersionReq>,
pub manifest_path: Option<PathBuf>,
pub cargo_toml_fetch_override: Option<CargoTomlFetchOverride>,
pub cli_overrides: PkgOverride,
pub desired_targets: DesiredTargets,