clyde
clyde copied to clipboard
Add a way to define custom fetchers
Goal
Make it possible to fetch updates for packages not hosted on GitHub.
Syntax
New fetch entry in the package file:
fetch:
type: auto|github|gitlab|script|none # defaults to auto
# fetch type specific entries
auto fetcher
Loops on all fetchers, if one of them says it supports the repository, use it. Otherwise, use none.
github fetcher
Uses GitHub API to fetch releases.
gitlab fetcher
Uses GitLab API to fetch releases.
script fetcher
Runs "$package_dir/fetch". Must be a standalone script.
Must print JSON:
{
"version": $str,
"assets": {
"$arch_os": "$url"
}
}
Implementation steps
- [x] Implement GitLab fetcher
- [x] Introduce a
Fetchertrait:
trait Fetcher {
fn can_fetch(package: &Package) -> bool;
fn fetch(ui: &Ui, package: &Package) -> Result<UpdateStatus>;
}
- [ ] Add support for the
fetch.typeentries to the package format. - [ ] Implement script fetcher.