forked from apuntes-uam-infomat/apuntes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpack
More file actions
executable file
·45 lines (33 loc) · 700 Bytes
/
Copy pathpack
File metadata and controls
executable file
·45 lines (33 loc) · 700 Bytes
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
#!/bin/bash
course="$1"
tmpdir=/tmp/$course
ignorable_tex="tikzaux.tex"
if [ -z "$course" ]; then
echo "Uso: pack [nombre curso]"
exit
fi
if [ ! -d "$course" ]; then
echo "El curso $course no existe en los apuntes."
exit
fi
cd "$course"
if [ -d "$tmpdir" ]; then
echo "Restaurando directorio temporal."
rm -r "$tmpdir"
fi
mkdir -p "$tmpdir"
for tex in $(ls *.tex); do
if [[ ! $ignorable_tex =~ "$tex" ]]; then
cp -v $tex "$tmpdir"
fi
done
cp -vr tex pdf "$tmpdir"
mkdir -p "${tmpdir}/tikz"
cp -vr tikz/*.tex "${tmpdir}/tikz"
cd ..
cd "Cosas Guays LaTeX"
cp -vr *.sty *.cls "$tmpdir"
cd ..
cwd=$(pwd)
cd $(dirname "$tmpdir")
zip -r "${cwd}/${course}.zip" "$(basename "$tmpdir")"