-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclear_aux.zsh
51 lines (46 loc) · 1.23 KB
/
clear_aux.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/zsh
rm **/*.mtc*
rm **/*.out
# rm **/*.synctex*
rm **/*.toc
rm **/*.blg
rm **/*.bbl
rm **/*.maf
rm **/*.aux
rm **/*.log
rm **/*.fdb_latexmk
rm **/*.fls
rm **/*.loa
rm **/*.lof
rm **/*.hd
rm **/*.pygtex
rm **/*.pygstyle
find ./aux_files -type d -empty -delete
# creating aux directories manually to avoid errors on compiling
if [[ ! -d "./aux_files" ]]; then
if [[ $1 == "-v" || $2 == "-v" ]]; then
echo "directory \"./aux_files\" does not exist"
echo "creating directory \"./aux_files\""
fi
mkdir -p "./aux_files"
fi
# ⚠️ | fixing the error : I CANT WRITE TO FILE
# $ | when the include is in a subfolder
content_list=(src/content/*)
# removes "src/"
content_list_trimmed=("${content_list[@]/#src\//}")
for item in "${content_list_trimmed[@]}"; do
if [[ $1 == "-v" || $2 == "-v" ]]; then
echo "checking if directory $item is available in aux_files..."
fi
if [ ! -d "aux_files/$item" ]; then
if [[ $1 == "-v" || $2 == "-v" ]]; then
echo "creating directory $item in aux_files..."
fi
mkdir -p "aux_files/$item"
else
if [[ $1 == "-v" || $2 == "-v" ]]; then
echo "directory $item already exists in aux_files..."
fi
fi
done