From 604eb7a6e68dfcab2ff57cea7b622ccd69b6a92f Mon Sep 17 00:00:00 2001 From: Timothy Stewart Date: Mon, 25 Mar 2024 13:36:08 -0500 Subject: [PATCH] fix(script): fixed yq --- .github/download-boxes.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/download-boxes.sh b/.github/download-boxes.sh index 4cdefed..1d65043 100755 --- a/.github/download-boxes.sh +++ b/.github/download-boxes.sh @@ -9,15 +9,17 @@ set -euo pipefail GIT_ROOT=$(git rev-parse --show-toplevel) PROVIDER=virtualbox -# requires yq 3 yq --version -# Read all boxes for all platforms from the "molecule.yml" files -all_boxes=$(cat "${GIT_ROOT}"/molecule/*/molecule.yml | - yq r '.platforms[].box' | # Read the "box" property of each node under "platforms" - grep --invert-match --regexp=--- | # Filter out file separators - sort | - uniq) +# Define the path to the molecule.yml files +MOLECULE_YML_PATH="${GIT_ROOT}/molecule/*/molecule.yml" + +# Extract and sort unique boxes from all molecule.yml files +all_boxes=$(for file in $MOLECULE_YML_PATH; do + yq eval '.platforms[].box' "$file" +done | sort -u) + +echo all_boxes: "$all_boxes" # Read the boxes that are currently present on the system (for the current provider) present_boxes=$(