Update Fitch trick solutions.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
8fc2c479de
commit
cbf4e80161
23 changed files with 991 additions and 476 deletions
88
clean-latex-junk.sh
Executable file
88
clean-latex-junk.sh
Executable file
|
|
@ -0,0 +1,88 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DRY_RUN=0
|
||||
|
||||
usage() {
|
||||
cat <<'USAGE'
|
||||
Usage: ./clean-latex-junk.sh [--dry-run]
|
||||
|
||||
Removes common LaTeX build byproducts from this repository, recursively.
|
||||
Source files and PDFs are not removed.
|
||||
|
||||
Options:
|
||||
--dry-run Print files that would be removed without deleting them.
|
||||
-h, --help Show this help.
|
||||
USAGE
|
||||
}
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--dry-run) DRY_RUN=1 ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) echo "Unknown option: $arg" >&2; usage; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
patterns=(
|
||||
"*.aux"
|
||||
"*.bcf"
|
||||
"*.blg"
|
||||
"*.fdb_latexmk"
|
||||
"*.fls"
|
||||
"*.lof"
|
||||
"*.log"
|
||||
"*.lot"
|
||||
"*.nav"
|
||||
"*.out"
|
||||
"*.run.xml"
|
||||
"*.snm"
|
||||
"*.synctex.gz"
|
||||
"*.toc"
|
||||
"*.vrb"
|
||||
"*.xdv"
|
||||
)
|
||||
|
||||
files=()
|
||||
while IFS= read -r -d '' file; do
|
||||
files+=("$file")
|
||||
done < <(
|
||||
find "$ROOT" \
|
||||
\( -path "$ROOT/.git" -o -path "$ROOT/.cursor" \) -prune \
|
||||
-o -type f \
|
||||
\( \
|
||||
-name "${patterns[0]}" \
|
||||
-o -name "${patterns[1]}" \
|
||||
-o -name "${patterns[2]}" \
|
||||
-o -name "${patterns[3]}" \
|
||||
-o -name "${patterns[4]}" \
|
||||
-o -name "${patterns[5]}" \
|
||||
-o -name "${patterns[6]}" \
|
||||
-o -name "${patterns[7]}" \
|
||||
-o -name "${patterns[8]}" \
|
||||
-o -name "${patterns[9]}" \
|
||||
-o -name "${patterns[10]}" \
|
||||
-o -name "${patterns[11]}" \
|
||||
-o -name "${patterns[12]}" \
|
||||
-o -name "${patterns[13]}" \
|
||||
-o -name "${patterns[14]}" \
|
||||
-o -name "${patterns[15]}" \
|
||||
\) -print0
|
||||
)
|
||||
|
||||
if ((${#files[@]} == 0)); then
|
||||
echo "No LaTeX build byproducts found."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ((DRY_RUN)); then
|
||||
echo "Would remove ${#files[@]} LaTeX build byproduct(s):"
|
||||
printf ' %s\n' "${files[@]#$ROOT/}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf 'Removing %s LaTeX build byproduct(s):\n' "${#files[@]}"
|
||||
printf ' %s\n' "${files[@]#$ROOT/}"
|
||||
rm -f -- "${files[@]}"
|
||||
echo "Done."
|
||||
Loading…
Add table
Add a link
Reference in a new issue