mirror of
https://github.com/nix-community/nurl.git
synced 2024-08-17 05:50:22 +03:00
sort fetchers
This commit is contained in:
parent
a1d664e45e
commit
b495a23e6c
@ -51,9 +51,9 @@ pub struct Opts {
|
||||
#[clap(rename_all = "camelCase")]
|
||||
pub enum FetcherFunction {
|
||||
FetchFromBitBucket,
|
||||
FetchFromGitea,
|
||||
FetchFromGitHub,
|
||||
FetchFromGitLab,
|
||||
FetchFromGitea,
|
||||
FetchFromSourcehut,
|
||||
Fetchgit,
|
||||
Fetchhg,
|
||||
|
@ -42,9 +42,9 @@ pub trait Fetcher {
|
||||
#[enum_dispatch(Fetcher)]
|
||||
pub enum FetcherDispatch {
|
||||
FetchFromBitBucket(FetchFromBitBucket),
|
||||
FetchFromGitea(FetchFromGitea),
|
||||
FetchFromGitHub(FetchFromGitHub),
|
||||
FetchFromGitLab(FetchFromGitLab),
|
||||
FetchFromGitea(FetchFromGitea),
|
||||
FetchFromSourcehut(FetchFromSourcehut),
|
||||
Fetchgit(Fetchgit),
|
||||
Fetchhg(Fetchhg),
|
||||
|
20
src/main.rs
20
src/main.rs
@ -43,14 +43,6 @@ fn main() -> Result<()> {
|
||||
bail!("fetchFromBitBucket only supports bitbucket.org");
|
||||
}
|
||||
|
||||
(
|
||||
None | Some(FetcherFunction::FetchFromGitea),
|
||||
Some(Host::Domain(host @ "codeberg.org")),
|
||||
) => FetchFromGitea(host.into()).into(),
|
||||
(Some(FetcherFunction::FetchFromGitea), Some(host)) => {
|
||||
FetchFromGitea(host.to_string()).into()
|
||||
}
|
||||
|
||||
(None | Some(FetcherFunction::FetchFromGitHub), Some(Host::Domain("github.com"))) => {
|
||||
FetchFromGitHub(None).into()
|
||||
}
|
||||
@ -68,6 +60,14 @@ fn main() -> Result<()> {
|
||||
FetchFromGitLab(Some(host.to_string())).into()
|
||||
}
|
||||
|
||||
(
|
||||
None | Some(FetcherFunction::FetchFromGitea),
|
||||
Some(Host::Domain(host @ "codeberg.org")),
|
||||
) => FetchFromGitea(host.into()).into(),
|
||||
(Some(FetcherFunction::FetchFromGitea), Some(host)) => {
|
||||
FetchFromGitea(host.to_string()).into()
|
||||
}
|
||||
|
||||
(None | Some(FetcherFunction::FetchFromSourcehut), Some(Host::Domain("git.sr.ht"))) => {
|
||||
FetchFromSourcehut(None).into()
|
||||
}
|
||||
@ -77,9 +77,9 @@ fn main() -> Result<()> {
|
||||
|
||||
(
|
||||
Some(
|
||||
fetcher @ (FetcherFunction::FetchFromGitea
|
||||
| FetcherFunction::FetchFromGitHub
|
||||
fetcher @ (FetcherFunction::FetchFromGitHub
|
||||
| FetcherFunction::FetchFromGitLab
|
||||
| FetcherFunction::FetchFromGitea
|
||||
| FetcherFunction::FetchFromSourcehut),
|
||||
),
|
||||
None,
|
||||
|
Loading…
Reference in New Issue
Block a user