mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
41 lines
958 B
Bash
Executable file
41 lines
958 B
Bash
Executable file
#!/bin/bash
|
|
|
|
FORCED=""
|
|
FILES=""
|
|
DISPMD=""
|
|
for opt in "$@" ; do
|
|
case $opt in
|
|
-f ) FORCED=$opt ;;
|
|
-d ) DISPMD=$opt ;;
|
|
-* ) echo "Unknown option $opt"; exit -1 ;;
|
|
* ) FILES="$FILES $opt" ;;
|
|
esac
|
|
done
|
|
|
|
if [[ "$FILES" != "" ]]; then
|
|
PREVIEW_LIBS="$FILES"
|
|
else
|
|
PREVIEW_LIBS="Transforms Distributors Basic_Shapes FractalTree"
|
|
fi
|
|
|
|
dir="$(basename $PWD)"
|
|
if [ "$dir" = "BOSL2" ]; then
|
|
cd BOSL2.wiki
|
|
elif [ "$dir" != "BOSL2.wiki" ]; then
|
|
echo "Must run this script from the BOSL2 or BOSL2/BOSL2.wiki directories."
|
|
exit 1
|
|
fi
|
|
|
|
rm -f tmp_*.scad
|
|
for base in $PREVIEW_LIBS; do
|
|
base="$(basename $base .md)"
|
|
mkdir -p images/tutorials
|
|
rm -f images/tutorials/${base}_*.png images/tutorials/${base}_*.gif
|
|
echo "$base.md"
|
|
../scripts/tutorial_gen.py ../tutorials/$base.md -o Tutorial-$base.md $FORCED -I images/tutorials/ || exit 1
|
|
if [ "$DISPMD" != "" ]; then
|
|
open -a Typora Tutorial-$base.md
|
|
fi
|
|
done
|
|
|
|
|