mirror of
https://github.com/moku-project/Moku.git
synced 2026-06-13 09:19:56 -05:00
Chore: Update Versions-Script for MacOS
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
# Sourced by CI jobs that need versions from nix/versions.nix.
|
# Sourced by CI jobs that need versions from nix/versions.nix.
|
||||||
# Usage: source .github/read_versions.sh
|
# 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
|
# 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"
|
_nix="$( cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd )/nix/versions.nix"
|
||||||
_t=$(cat "$_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 MOKU_VERSION=$(_pick "moku")
|
||||||
export SUWA_VERSION=$(_pick "version")
|
export SUWA_VERSION=$(_pick "version")
|
||||||
|
|||||||
Reference in New Issue
Block a user