Log the version and cpu info when rendering models

This commit is contained in:
mmcwilliams 2020-05-22 12:51:27 -04:00
parent 0b1aaadb38
commit 6962744925
2 changed files with 16 additions and 1 deletions

12
scripts/cpu.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
CPU=-1
elif [[ "$OSTYPE" == "darwin"* ]]; then
CPU=`sysctl -a | grep machdep.cpu.brand_string | awk '{for (i=2; i<=NF; i++) print $i}'`
else
CPU=-1
fi
echo $CPU

View File

@ -3,6 +3,7 @@
echo "Compiling GNAL v1"
VERSION=`openscad -v 2>&1 >/dev/null | awk '{print $3}'`
CPU=`bash ./scripts/cpu.sh`
DIST=./dist/
NOTES=./notes/v1.csv
FILES=( "spacer" "top" "spiral_top" "spiral_bottom" )
@ -31,6 +32,8 @@ do
hash=`sha256sum "${DIST}/${SIZE}_v1/gnal_${SIZE}_${FILE}.stl" | awk '{ print $1 }'`
fileSize=`wc -c < "${DIST}/${SIZE}_v1/gnal_${SIZE}_${FILE}.stl"`
fileSize=`echo $fileSize | xargs`
echo "gnal_${SIZE}_${FILE}.stl,$hash,$fileSize,$srchash,$srcsize,$runtime" >> $NOTES
line="${VERSION},${CPU},gnal_${SIZE}_${FILE}.stl,$hash,$fileSize,$srchash,$srcsize,$runtime"
echo "$line" >> $NOTES
echo "$line"
done
done