pinouts process is broken but also green #2942
This commit is contained in:
parent
7302e5faca
commit
402548f757
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
I_AM="gen_upload_pinouts.sh:"
|
||||
|
||||
if [ -z $1 ] ; then
|
||||
echo "Specific yaml parameter not specified, searching for */connectors/*.yaml"
|
||||
CONNECTORS=$(find -path "./firmware/config/boards/*/connectors/*.yaml")
|
||||
|
@ -8,19 +10,24 @@ else
|
|||
echo "Processing $CONNECTORS"
|
||||
fi
|
||||
# yq 3 and 4 have incompatible syntax. We use yq 4.
|
||||
echo ${I_AM} invoking yq version
|
||||
yq -V
|
||||
for c in $CONNECTORS; do
|
||||
echo "processing "$c
|
||||
echo "${I_AM} processing "$c
|
||||
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')
|
||||
echo "DIR "$DIR
|
||||
echo "${I_AM} DIR "$DIR
|
||||
NAME=$(basename $c .yaml)
|
||||
echo "NAME "$NAME
|
||||
echo "${I_AM} NAME "$NAME
|
||||
mkdir -p $DIR
|
||||
if [ -f $DIR/index.html ]; then
|
||||
bash misc/pinout-gen/append.sh "$(yq -j e $c)" $DIR/index.html
|
||||
else
|
||||
bash misc/pinout-gen/gen.sh "$(yq -j e $c)" $DIR/index.html
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "${I_AM} something is broken"
|
||||
exit 1;
|
||||
fi
|
||||
file $DIR/index.html
|
||||
IMG=$(yq e '.info.image.file' $c)
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
|
@ -2,4 +2,8 @@
|
|||
|
||||
DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)"/"
|
||||
TEXT=$(sed -e "/\/\/\/DATA\/\/\//{a \ \`$1\ \`,\n///DATA///" -e "d}" $2)
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error in append.sh"
|
||||
exit 1;
|
||||
fi
|
||||
echo "$TEXT" > $2
|
||||
|
|
|
@ -2,4 +2,8 @@
|
|||
|
||||
DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)"/"
|
||||
TEXT=$(sed -e "/###CSS###/{r ${DIR}style.css" -e 'd}' -e "/###JS###/{r ${DIR}script.js" -e 'd}' ${DIR}pinout.html | sed -e "s/\/\/\/DATA\/\/\//\`$(echo ${1//\//\\/} | tr -d '\n')\`,\n\/\/\/DATA\/\/\//")
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error in gen.sh"
|
||||
exit 1;
|
||||
fi
|
||||
echo "$TEXT" > $2
|
||||
|
|
Loading…
Reference in New Issue