2021-02-06 10:43:43 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-02-19 14:00:30 -08:00
|
|
|
if [ -z $1 ] ; then
|
|
|
|
echo "Specific yaml parameter not specified, searching for */connectors/*.yaml"
|
|
|
|
CONNECTORS=$(find -path "./firmware/config/boards/*/connectors/*.yaml")
|
|
|
|
else
|
|
|
|
CONNECTORS=$1
|
|
|
|
echo "Processing $CONNECTORS"
|
|
|
|
fi
|
2021-02-06 10:43:43 -08:00
|
|
|
for c in $CONNECTORS; do
|
|
|
|
echo "processing "$c
|
|
|
|
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')
|
|
|
|
echo "DIR "$DIR
|
|
|
|
NAME=$(basename $c .yaml)
|
|
|
|
echo "NAME "$NAME
|
|
|
|
mkdir -p $DIR
|
2021-02-10 15:52:19 -08:00
|
|
|
if [ -f $DIR/index.html ]; then
|
|
|
|
bash misc/pinout-gen/append.sh $c $DIR/index.html
|
|
|
|
else
|
|
|
|
bash misc/pinout-gen/gen.sh $c $DIR/index.html
|
|
|
|
fi
|
|
|
|
file $DIR/index.html
|
2021-02-06 10:43:43 -08:00
|
|
|
IMG=$(yq r $c 'info.image.file')
|
|
|
|
echo "IMG "$IMG
|
|
|
|
if [ $IMG ]; then
|
|
|
|
cp $(dirname $c)/$IMG $DIR
|
|
|
|
fi
|
|
|
|
ls $DIR
|
|
|
|
cp misc/pinout-gen/yaml.min.js $DIR
|
|
|
|
ls $DIR
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ -n "$RUSEFI_FTP_SERVER" ]; then
|
|
|
|
echo "Uploading Pinouts"
|
2021-02-12 12:56:49 -08:00
|
|
|
ncftpput -R -z -m -V -u "$RUSEFI_DOXYGEN_FTP_USER" -p "$RUSEFI_DOXYGEN_FTP_PASS" "$RUSEFI_FTP_SERVER" / pinouts
|
2021-02-06 10:43:43 -08:00
|
|
|
fi
|
|
|
|
[ $? -eq 0 ] || { echo "upload FAILED"; exit 1; }
|