feat: ubi forge option support (#4642)

https://docs.rs/ubi/0.5.2/ubi/struct.UbiBuilder.html#method.forge

Without this, gitlab.com projects can be installed by specifying the
full URL, but that's a bit unwieldy and doesn't work for other GitLab
instances besides the gitlab.com one.
This commit is contained in:
Ville Skyttä 2025-03-18 13:01:28 +02:00 committed by GitHub
parent bfe8323964
commit 5b13e4e1a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -14,8 +14,9 @@ use regex::Regex;
use std::env; use std::env;
use std::fmt::Debug; use std::fmt::Debug;
use std::path::Path; use std::path::Path;
use std::str::FromStr;
use std::sync::OnceLock; use std::sync::OnceLock;
use ubi::UbiBuilder; use ubi::{ForgeType, UbiBuilder};
use xx::regex; use xx::regex;
#[derive(Debug)] #[derive(Debug)]
@ -115,6 +116,9 @@ impl Backend for UbiBackend {
if let Some(matching) = opts.get("matching") { if let Some(matching) = opts.get("matching") {
builder = builder.matching(matching); builder = builder.matching(matching);
} }
if let Some(forge) = opts.get("forge") {
builder = builder.forge(ForgeType::from_str(forge)?);
}
let mut ubi = builder.build().map_err(|e| eyre::eyre!(e))?; let mut ubi = builder.build().map_err(|e| eyre::eyre!(e))?;