Skip to content

Instantly share code, notes, and snippets.

@Josef-Friedrich
Last active February 14, 2018 23:23
Show Gist options
  • Save Josef-Friedrich/b7c791c745caef7dcdda to your computer and use it in GitHub Desktop.
Save Josef-Friedrich/b7c791c745caef7dcdda to your computer and use it in GitHub Desktop.
pre-commit hook to clean up tex, latex repository
#! /bin/sh
# Extensions:
EXT="aux fdb_latexmk log out pdf synctex.gz"
# Symlink to .git/hooks/pre-commit
# cd .git/hook
# ln -s ../../.githook_pre-commit pre-commit
_remove() {
find . -iname "*.$1" -exec rm -f {} \;
}
for i in $EXT; do
_remove $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment