Skip to content

Commit

Permalink
Make the macOS regex allow macosx
Browse files Browse the repository at this point in the history
  • Loading branch information
kattouf authored and autarch committed Dec 23, 2024
1 parent ce9785f commit bfa308d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.2.5

- When looking for macOS assets, `ubi` will now match against `macosx` in asset names, not just
`macos` and `osx`. Implemented by @kattouf (Vasiliy Kattouf). GH #80.

## 0.2.4 - 2024-11-24

- `ubi` will now look for just "mac" or "Mac" in a filename when running on macOS. Previously, `ubi`
Expand Down
2 changes: 1 addition & 1 deletion ubi/src/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) fn linux_re() -> &'static Lazy<Regex> {
}

pub(crate) fn macos_re() -> &'static Lazy<Regex> {
regex!(r"(?i:(?:\b|_)(?:darwin|mac(?:os)?|osx)(?:\b|_))")
regex!(r"(?i:(?:\b|_)(?:darwin|mac(?:osx?)?|osx)(?:\b|_))")
}

pub(crate) fn netbsd_re() -> &'static Lazy<Regex> {
Expand Down
7 changes: 7 additions & 0 deletions ubi/src/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,13 @@ mod test {
1 ;
"aarch64-apple-darwin - pick asset with 'mac' in the name"
)]
#[test_case(
"aarch64-apple-darwin",
&["project-Linux-x86-64.tar.gz", "project-Macosx-x86-64.tar.gz"],
None,
1 ;
"aarch64-apple-darwin - pick asset with 'macosx' in the name"
)]
#[test_case(
"aarch64-apple-darwin",
&["project-Macos-x86-64.tar.gz", "project-Macos-aarch64.tar.gz"],
Expand Down

0 comments on commit bfa308d

Please sign in to comment.