Move pinouts to pages.rusefi.com #170

This commit is contained in:
rusefillc 2021-10-13 21:04:02 -04:00
parent d5de9f8b17
commit 1ed5658d1e
3 changed files with 45 additions and 39 deletions

43
misc/actions/pinouts-create.sh Executable file
View File

@ -0,0 +1,43 @@
#!/bin/bash
I_AM="pinouts-create.sh:"
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")
else
CONNECTORS=$1
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 "${I_AM} processing "$c
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')
echo "${I_AM} DIR "$DIR
NAME=$(basename $c .yaml)
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
exit 1;
fi
echo "IMG "$IMG
if [ "$IMG" != "null" ]; then
cp $(dirname $c)/$IMG $DIR
fi
ls $DIR
done

View File

@ -4,5 +4,6 @@
sudo apt-get install ncftp
wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64
chmod a+x yq_linux_amd64
rm -rf yqdir
mkdir yqdir
mv yq_linux_amd64 yqdir/yq

View File

@ -1,44 +1,6 @@
#!/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")
else
CONNECTORS=$1
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 "${I_AM} processing "$c
DIR="pinouts/"$(echo $c | tr '/' '\n' | tail -n +5 | head -n -2 | tr '\n' '/')
echo "${I_AM} DIR "$DIR
NAME=$(basename $c .yaml)
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
exit 1;
fi
echo "IMG "$IMG
if [ "$IMG" != "null" ]; then
cp $(dirname $c)/$IMG $DIR
fi
ls $DIR
done
misc/actions/pinouts-create.sh
if [ -n "$RUSEFI_FTP_SERVER" ]; then
echo "Uploading Pinouts..."