From 2905ec486acb29d76ed11e3795db4186436dd27e Mon Sep 17 00:00:00 2001 From: Gustavo de Morais Date: Mon, 20 Jan 2025 13:15:21 +0100 Subject: [PATCH] [FLINK-37176][docs] Support mac binary for setup_hugo --- docs/setup_hugo.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) mode change 100644 => 100755 docs/setup_hugo.sh diff --git a/docs/setup_hugo.sh b/docs/setup_hugo.sh old mode 100644 new mode 100755 index 5f3fa290284..0abd54fcb56 --- a/docs/setup_hugo.sh +++ b/docs/setup_hugo.sh @@ -18,8 +18,19 @@ ################################################################################ # setup hugo -HUGO_REPO=https://github.com/gohugoio/hugo/releases/download/v0.110.0/hugo_extended_0.110.0_Linux-64bit.tar.gz -HUGO_ARTIFACT=hugo_extended_0.110.0_Linux-64bit.tar.gz + +# Detect Operating System +OS="Linux" +[[ "$OSTYPE" == "darwin"* ]] && OS="Mac" + +# Setup Hugo based on OS +if [ "$OS" = "Mac" ]; then + HUGO_ARTIFACT="hugo_extended_0.110.0_darwin-universal.tar.gz" +else + HUGO_ARTIFACT="hugo_extended_0.110.0_Linux-64bit.tar.gz" +fi + +HUGO_REPO="https://github.com/gohugoio/hugo/releases/download/v0.110.0/${HUGO_ARTIFACT}" if ! curl --fail -OL $HUGO_REPO ; then echo "Failed to download Hugo binary" exit 1