Open brianheineman opened 5 months ago
hey @brianheineman, thanks for adding this! Could you make this configurable? either adding a skip_extensions: Option<&[&str]>
argument or ideally to maintain backwards compatibility adding a separate method asset_for_config(config: &AssetMatchConfig)
that takes some new config struct with the options
Hello @jaemk, I made changes that should be more flexible and backwards compatible by allowing a "match function" to be specified.
fn update() -> Result<(), Box<::std::error::Error>> {
let status = self_update::backends::github::Update::configure()
.repo_owner("jaemk")
.repo_name("self_update")
.bin_name("github")
.show_download_progress(true)
.current_version(cargo_crate_version!())
.asset_match_fn(|release, target, identifier| {
// custom matching logic here
...
})
.build()?
.update()?;
println!("Update status: `{}`!", status.version());
Ok(())
}
Please let me know if this achieves what you were looking for.
Skip
sha
(sha1
,sha256
,sha512
) checksum files when determining the release asset. Many projects (e.g. https://github.com/BurntSushi/ripgrep/releases, https://github.com/theseus-rs/rsql/releases, etc) include hash files with their releases, this change ignores the.sha*
hash files when attempting to find the release archive.