Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
0xHiteshPatel committed Jul 24, 2017
1 parent 9715818 commit 59cb9da
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions containthedocs-pdf-perclass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

set -x

. ./containthedocs-image

WD=$PWD

mkdir -p tmp pdf
cd docs
find . -type f ! -path "./class*" | tar -cf ../tmp/base.tar -T -
cd ..

for i in `find . -maxdepth 2 -name class* -type d`
do
CLASS=`basename $i`
cd $WD/tmp
mkdir $WD/tmp/$CLASS
cd $WD/tmp/$CLASS
tar -xf $WD/tmp/base.tar
cp -Rf $WD/docs/$CLASS .
docker run --rm -it \
-v $PWD:$PWD --workdir $PWD \
${DOCKER_RUN_ARGS} \
-e "LOCAL_USER_ID=$(id -u)" \
${DOC_IMG} make latexpdf

PDFPATH=`ls _build/latex/*.pdf`
PDFNAME=${PDFPATH##*/}
NAME=${PDFNAME%.pdf}
cp $PDFPATH $WD/pdf/$NAME-$CLASS.pdf
cd ..
rm -Rf $WD/tmp/$CLASS
done
cd ..
rm -Rf $WD/tmp

echo ""
echo "Done... per-class PDF's are in the ./pdf directory"

0 comments on commit 59cb9da

Please sign in to comment.