From 329d944fafebe87f38501597fd7eb65957e4bf21 Mon Sep 17 00:00:00 2001 From: pranaydotparity Date: Mon, 11 Nov 2024 10:19:51 +0100 Subject: [PATCH] Add yq download to script --- dotlakeIngest.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dotlakeIngest.sh b/dotlakeIngest.sh index 0f2f83c..e8dd341 100644 --- a/dotlakeIngest.sh +++ b/dotlakeIngest.sh @@ -1,5 +1,23 @@ #!/bin/bash +# Check the operating system and install yq if not already installed +if [[ $(uname) == "Darwin" ]]; then + # macOS + if ! command -v yq &> /dev/null; then + echo "yq is not installed. Installing yq..." + brew install yq + fi +elif [[ $(uname) == "Linux" ]]; then + # Linux + if ! command -v yq &> /dev/null; then + echo "yq is not installed. Installing yq..." + go install github.com/mikefarah/yq/v4@latest + fi +else + echo "Unsupported operating system. Please install yq manually." + exit 1 +fi + # Check if yq is installed if ! command -v yq &> /dev/null; then echo "yq is not installed. Please install it to parse YAML files."