mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-23 02:56:37 +00:00
feat: Add repository host Codeberg (#2202)
This commit is contained in:
parent
4628235403
commit
a90dd4569f
4 changed files with 19 additions and 2 deletions
|
@ -9,6 +9,7 @@ pub enum RepositoryHost {
|
|||
GitLab,
|
||||
BitBucket,
|
||||
SourceForge,
|
||||
Codeberg,
|
||||
Unknown,
|
||||
}
|
||||
|
||||
|
@ -65,6 +66,7 @@ impl RepositoryHost {
|
|||
Some(domain) if domain.starts_with("gitlab") => GitLab,
|
||||
Some("bitbucket.org") => BitBucket,
|
||||
Some("sourceforge.net") => SourceForge,
|
||||
Some("codeberg.org") => Codeberg,
|
||||
_ => Unknown,
|
||||
}
|
||||
}
|
||||
|
@ -95,6 +97,12 @@ impl RepositoryHost {
|
|||
&[FULL_FILENAMES, NOVERSION_FILENAMES],
|
||||
"/download",
|
||||
)),
|
||||
Codeberg => Some(apply_filenames_to_paths(
|
||||
// Codeberg (Forgejo) has the same release paths as GitHub.
|
||||
GITHUB_RELEASE_PATHS,
|
||||
&[FULL_FILENAMES, NOVERSION_FILENAMES],
|
||||
"",
|
||||
)),
|
||||
Unknown => None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -290,6 +290,7 @@ impl RepoInfo {
|
|||
match repository_host {
|
||||
RepositoryHost::GitHub => Self::detect_subcrate_common(repo, &["tree"]),
|
||||
RepositoryHost::GitLab => Self::detect_subcrate_common(repo, &["-", "blob"]),
|
||||
RepositoryHost::Codeberg => Self::detect_subcrate_common(repo, &["src", "branch"]),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue