diff options
| author | nic <ra@afu.re> | 2023-12-31 14:24:44 -0500 |
|---|---|---|
| committer | nic <ra@afu.re> | 2023-12-31 14:24:44 -0500 |
| commit | 84ee878342ebfa109ac547b91616eabbd7bfd30a (patch) | |
| tree | 8fd84e3d9bece3700d7fec9b68ad13c4367384ec /.local/bin/texclear | |
Initial commit
Diffstat (limited to '.local/bin/texclear')
| -rwxr-xr-x | .local/bin/texclear | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.local/bin/texclear b/.local/bin/texclear new file mode 100755 index 0000000..aa494bc --- /dev/null +++ b/.local/bin/texclear @@ -0,0 +1,15 @@ +#!/bin/sh + +# Clears the build files of a LaTeX/XeLaTeX build. +# I have vim run this file whenever I exit a .tex file. + +case "$1" in + *.tex) + file=$(readlink -f "$1") + dir=$(dirname "$file") + base="${file%.*}" + find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyg|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete + rm -rdf "$dir/_minted-$(basename -- "$base")" + ;; + *) printf "Give .tex file as argument.\\n" ;; +esac |
