summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
authorEmre AKYÜZ <emreakyuz_2@hotmail.com>2024-07-15 20:18:02 +0300
committerGitHub <noreply@github.com>2024-07-15 17:18:02 +0000
commit22141ca7543e98c21ec721acaa3f9f4ff42157bd (patch)
treea450e3e6d6f4d9c55f97d585822efe74cda2b298 /.local
parentb4b462029cca2b2066e6065495cf407d107739a1 (diff)
downloadeibhear-22141ca7543e98c21ec721acaa3f9f4ff42157bd.tar.gz
eibhear-22141ca7543e98c21ec721acaa3f9f4ff42157bd.tar.zst
eibhear-22141ca7543e98c21ec721acaa3f9f4ff42157bd.zip
[texclear] - minimize | streamline (#1390)
Diffstat (limited to '.local')
-rwxr-xr-x.local/bin/texclear13
1 files changed, 3 insertions, 10 deletions
diff --git a/.local/bin/texclear b/.local/bin/texclear
index 4cdb02e..6ad3c12 100755
--- a/.local/bin/texclear
+++ b/.local/bin/texclear
@@ -3,14 +3,7 @@
# 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
+[ "${1##*.}" = "tex" ] && {
+ find "$(dirname "${1}")" -regex '.*\(_minted.*\|.*\.\(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
+} || printf "Provide a .tex file.\n"