From 4b840075f44da10a9b3a4f0bf3fe78c2e24e7e8d Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Thu, 30 May 2024 12:08:13 -0500 Subject: [PATCH] Patch cd.fish test to support older macOS versions The sysctl kern.osproductversion is not available on the oldest versions we support. --- tests/checks/cd.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/checks/cd.fish b/tests/checks/cd.fish index ceaa2e781..83c3c3d98 100644 --- a/tests/checks/cd.fish +++ b/tests/checks/cd.fish @@ -276,7 +276,8 @@ complete -C'cd .' # This is first supported on macOS 12. # `sysctl kern.osproductversion` emits something like: # kern.osproductversion: 14.3.1 -if test (uname) = "Darwin" && test (sysctl kern.osproductversion | string match -r \\d+) -lt 12 +# Note that there is no kern.osproductversion under older OS X releases! +if test (uname) = "Darwin" && test (sysctl kern.osproductversion 2>/dev/null | string match -r \\d+; or echo 10) -lt 12 # Not supported. Satisfy the CHECKs below. echo fake/a echo fake/a/b