From 69627449259e3440a9250ae5856c24e9a031454a Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Fri, 22 May 2020 12:51:27 -0400 Subject: [PATCH] Log the version and cpu info when rendering models --- scripts/cpu.sh | 12 ++++++++++++ scripts/v1.sh | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 scripts/cpu.sh diff --git a/scripts/cpu.sh b/scripts/cpu.sh new file mode 100644 index 0000000..fae7633 --- /dev/null +++ b/scripts/cpu.sh @@ -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 \ No newline at end of file diff --git a/scripts/v1.sh b/scripts/v1.sh index 4ea8cdd..aea2010 100644 --- a/scripts/v1.sh +++ b/scripts/v1.sh @@ -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