Skip to content

Instantly share code, notes, and snippets.

@jgru
Created December 14, 2022 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgru/56490a666505bf181de43dc36403c216 to your computer and use it in GitHub Desktop.
Save jgru/56490a666505bf181de43dc36403c216 to your computer and use it in GitHub Desktop.
Helper script to create a publishable tarball containing all the TeX-sources
#!/bin/bash
PROJ="paper-724_"
INDIR="final/"
OUTDIR="$(date +%Y-%m-%d)_${PROJ}"
CWD="$(pwd)"
ARCH=".zip" # or .tar.gz
# Create tmp directory
TMP=$(mktemp -d)
mkdir -p ${TMP}/${OUTDIR}
cp -r ${INDIR}/* ${TMP}/${OUTDIR}/
cd ${TMP}/${OUTDIR}/
# Build the doc
make purge
rm -rf copyright-agreement
rm -rf .auctex-auto
cd ${TMP}
if [[ ${ARCH} == ".zip" ]];
then
zip -r ${OUTDIR}.zip ./${OUTDIR}
cp ${OUTDIR}.zip ${CWD}/
else
tar -czvf ${OUTDIR}.tar.gz ./${OUTDIR}
cp ${OUTDIR}.tar ${CWD}/
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment