From 6e13304c6faa2bb0c68ea2cd8319c2d9e86ba2dc Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 13 Sep 2024 00:12:27 +0300 Subject: [PATCH 1/2] fix(scripts): allow docs_update_experiments.sh to be run on macOS --- scripts/lib.sh | 7 +++++++ scripts/release/docs_update_experiments.sh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/scripts/lib.sh b/scripts/lib.sh index e245fb4ab8cc7..f8253bb4c3219 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -108,6 +108,13 @@ dependencies() { for dep in "$@"; do if ! dependency_check "$dep"; then log "ERROR: The '$dep' dependency is required, but is not available." + if isdarwin; then + case "$dep" in + gsed|gawk) + log "- brew install $dep" + ;; + esac + fi fail=1 fi done diff --git a/scripts/release/docs_update_experiments.sh b/scripts/release/docs_update_experiments.sh index 2168fc4d11c9d..8ed380a356a2e 100755 --- a/scripts/release/docs_update_experiments.sh +++ b/scripts/release/docs_update_experiments.sh @@ -12,6 +12,12 @@ set -euo pipefail source "$(dirname "${BASH_SOURCE[0]}")/../lib.sh" cdroot +if isdarwin; then + dependencies gsed gawk + sed() { gsed "$@"; } + awk() { gawk "$@"; } +fi + # From install.sh echo_latest_stable_version() { # https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860 From e04628c60763081ac1aa3e9857c9b31a6d0c112d Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 13 Sep 2024 00:15:21 +0300 Subject: [PATCH 2/2] Update lib.sh --- scripts/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index f8253bb4c3219..fb6220eecb85e 100644 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -110,7 +110,7 @@ dependencies() { log "ERROR: The '$dep' dependency is required, but is not available." if isdarwin; then case "$dep" in - gsed|gawk) + gsed | gawk) log "- brew install $dep" ;; esac