Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ thiserror = "2"
tokio = { version = "1", features = ["full"] }
toml = { version = "0.8", features = ["parse"] }
toml_edit = { version = "0.22", features = ["parse"] }
ubi = { version = "0.6.1", default-features = false }
ubi = { version = "0.7.1", default-features = false }
url = "2"
urlencoding = "2.1.3"
usage-lib = { version = "2", features = ["clap", "docs"] }
Expand Down
11 changes: 11 additions & 0 deletions docs/dev-tools/backends/ubi.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ then this will be ignored.
"ubi:BurntSushi/ripgrep" = { version = "latest", matching = "musl" }
```

### `matching_regex`

Set a regular expression string that will be matched against release filenames before matching
against OS/arch. If the pattern yields a single match, that release will be selected. If no matches
are found, this will result in an error.

```toml
[tools]
"ubi:shader-slang/slang" = { version = "latest", matching_regex = "\\d+\\.tar" }
```

### `provider`

Set the provider type to use for fetching assets and release information. Either `github` or `gitlab` (default is `github`).
Expand Down
3 changes: 3 additions & 0 deletions src/backend/ubi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ async fn install(
if let Some(matching) = opts.get("matching") {
builder = builder.matching(matching);
}
if let Some(matching_regex) = opts.get("matching_regex") {
builder = builder.matching_regex(matching_regex);
}

let forge = match opts.get("provider") {
Some(forge) => ForgeType::from_str(forge)?,
Expand Down
Loading