Generate matrix from directory

This commit is contained in:
Yethal
2023-03-29 14:09:16 +02:00
committed by Jeremy Soller
parent fe6faa21fc
commit faede6264a
2 changed files with 25 additions and 49 deletions

16
scripts/boards.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-only
set -eE
EXCLUDED_BOARDS=(
"system76/common"
"arduino/uno"
"arduino/micro"
)
BOARDS=$(find src/board -type d -maxdepth 2 -mindepth 2 2>/dev/null \
| grep -vFf <(printf '%s\n' "${EXCLUDED_BOARDS[@]}") \
| jq -sRc 'split("\n")[:-1] | map(split("/")) | map({vendor: .[2], board: .[3]})'
)
echo "boards=${BOARDS}"