diff --git a/Changes.md b/Changes.md index 79d8464..a1bcf62 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,8 @@ +## 0.2.4 + +- Look for just "mac" or "Mac" in a filename on macOS. Previously, `ubi` would not treat a filename + like "foo-mac-x86-64.tar.gz" as a match for macOS. Reported by @jdx (Jeff Dickey). GH #79. + ## 0.2.3 - 2024-11-22 - Fixed the code to detect whether the filename includes a version number that looks like an diff --git a/ubi-cli/tests/ubi.rs b/ubi-cli/tests/ubi.rs index 14a30ab..80bcced 100644 --- a/ubi-cli/tests/ubi.rs +++ b/ubi-cli/tests/ubi.rs @@ -411,6 +411,22 @@ fn integration_tests() -> Result<()> { make_exe_pathbuf(&["bin", "direnv"]), )?; + // This project used just "mac" in the macOS release names, which `ubi` didn't look for until + // 0.2.4. + run_test( + td.path(), + ubi.as_ref(), + &[ + "--project", + "wren-lang/wren-cli", + "--tag", + "0.4.0", + "--exe", + "wren_cli", + ], + make_exe_pathbuf(&["bin", "wren_cli"]), + )?; + Ok(()) } diff --git a/ubi/src/os.rs b/ubi/src/os.rs index a442af7..12d0d06 100644 --- a/ubi/src/os.rs +++ b/ubi/src/os.rs @@ -19,7 +19,7 @@ pub(crate) fn linux_re() -> &'static Lazy { } pub(crate) fn macos_re() -> &'static Lazy { - regex!(r"(?i:(?:\b|_)(?:darwin|macos|osx)(?:\b|_))") + regex!(r"(?i:(?:\b|_)(?:darwin|mac(?:os)?|osx)(?:\b|_))") } pub(crate) fn netbsd_re() -> &'static Lazy { diff --git a/ubi/src/picker.rs b/ubi/src/picker.rs index 42a5941..633ad28 100644 --- a/ubi/src/picker.rs +++ b/ubi/src/picker.rs @@ -468,6 +468,13 @@ mod test { 0 ; "aarch64-apple-darwin - pick one asset" )] + #[test_case( + "aarch64-apple-darwin", + &["project-Linux-x86-64.tar.gz", "project-Mac-x86-64.tar.gz"], + None, + 1 ; + "aarch64-apple-darwin - pick asset with 'mac' in the name" + )] #[test_case( "aarch64-apple-darwin", &["project-Macos-x86-64.tar.gz", "project-Macos-aarch64.tar.gz"],