Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More flexible build-pdfs #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion bin/build-pdfs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@
echo "Build pdfs"
currdir="`pwd`"
outdir="$currdir/output"

# if cant find md5sum or cut, exit
if ! [ -x "$(command -v md5sum)" ]; then
echo 'md5sum is not installed.' >&2
exit 1
fi

if ! [ -x "$(command -v cut)" ]; then
echo 'cut is not installed.' >&2
exit 1
fi

# get path to md5sum and cut
md5sum=`which md5sum`
cut=`which cut`

mkdir -p $1/digest
figdir=$1
mkdir -p $1/pdf
Expand All @@ -21,7 +37,7 @@ do
hashfile="${figdir}/digest/${svgfile/svg/digest}"
# srcdate=`stat -c %Y $svgfile`
# destdate=`stat -c %Y $pdffile 2>/dev/null`
svghashnew=`/usr/bin/md5sum $svgpath | /usr/bin/cut -f1 -d' '`
svghashnew=`$md5sum $svgpath | $cut -f1 -d' '`
# echo $svghashnew
if [ -f $hashfile ];
then
Expand Down