Pinout order (#4601)

* order by field

* add order to mre main
This commit is contained in:
David Holdeman 2022-09-21 09:09:18 -05:00 committed by GitHub
parent 3e400fdfbf
commit d8b2565741
2 changed files with 15 additions and 7 deletions

View File

@ -364,6 +364,7 @@ info:
name: Main Connector
board_url: https://rusefi.com/s/microrusefi
id: main
order: 0
image:
file: main.jpg
pins:

View File

@ -4,16 +4,23 @@ I_AM="pinouts-create.sh:"
I_AM="gen_upload_pinouts.sh:"
# yq 3 and 4 have incompatible syntax. We use yq 4.
echo ${I_AM} invoking yq version
yqdir/yq -V
if [ -z $1 ] ; then
echo "Specific yaml parameter not specified, searching for */connectors/*.yaml"
CONNECTORS=$(find -path "./firmware/config/boards/*/connectors/*.yaml")
FILES=$(for f in $CONNECTORS; do
ORDER=$(yqdir/yq e '.info.order' $f)
echo "$f $ORDER"
done)
CONNECTORS=$(echo "$FILES" | sort -k2 | cut -d ' ' -f 1)
else
CONNECTORS=$1
echo "Processing $CONNECTORS"
fi
# yq 3 and 4 have incompatible syntax. We use yq 4.
echo ${I_AM} invoking yq version
yqdir/yq -V
for c in $CONNECTORS; do
echo "${I_AM} processing "$c
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')