!/usr/bin/fish

if test -z $argv[1]

echo directory missing

exit 1

end

set d $argv[1]

if test ! -d $d

echo $d is not a directory

exit 2

end

echo Recreating the downloadable archive

rm -f "$d/1PDC $d.zip"

set imgs $d/*.jpg $d/*.jpeg

zip "$d/1PDC $d.zip" $d/*.pdf $imgs

echo Gzipping all the PDFs

gzip $d/*.pdf

echo Done