Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the macOS regex allow macosx #80

Merged
merged 1 commit into from
Dec 23, 2024
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
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
Loading