From be38d87bec6892ff31c2c203f0d5aec6cb9b86db Mon Sep 17 00:00:00 2001 From: Youwes09 Date: Fri, 12 Jun 2026 23:26:19 -0500 Subject: [PATCH] Chore: Update Versions-Script for MacOS --- .github/read_versions.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/read_versions.sh b/.github/read_versions.sh index 913c89e..d7e8b04 100644 --- a/.github/read_versions.sh +++ b/.github/read_versions.sh @@ -1,11 +1,15 @@ # Sourced by CI jobs that need versions from nix/versions.nix. # Usage: source .github/read_versions.sh # Exports: MOKU_VERSION SUWA_VERSION SUWA_HASH_LINUX SUWA_HASH_MACOS_ARM64 SUWA_HASH_MACOS_X64 SUWA_HASH_WINDOWS +# +# Uses only POSIX -E grep (no -P) so this works on both GNU grep (Linux/Windows) +# and BSD grep (macOS), which does not support -P/PCRE. _nix="$( cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd )/nix/versions.nix" _t=$(cat "$_nix") -_pick() { echo "$_t" | grep -oP "${1}\s*=\s*\"\K[^\"]+"; } +# Match `key = "value"` with -E, then strip the surrounding quotes. +_pick() { echo "$_t" | grep -oE "${1}"'[[:space:]]*=[[:space:]]*"[^"]+"' | grep -oE '"[^"]+"' | tr -d '"'; } export MOKU_VERSION=$(_pick "moku") export SUWA_VERSION=$(_pick "version")