-
Notifications
You must be signed in to change notification settings - Fork 31
/
install
executable file
·49 lines (37 loc) · 982 Bytes
/
install
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
#!/bin/bash
tred=$(tput setaf 1)
treset=$(tput sgr0)
latex_dir=$(dirname $(kpsewhich article.cls))
function trycopy() {
file=$1
dir="$2"
if [ -d "$dir" ] ; then
cp -vf "$file" "$dir"
fi
}
echo "Creating completion file..."
python cwlcreator.py exmath.sty exmath.cwl
trycopy exmath.cwl ~/.config/texstudio/completion/user
trycopy exmath.cwl ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/cwl/
trycopy exmath.cwl ~/.config/sublime-text-3/Packages/User/cwl/
echo "Copying packages..."
if ! cp -v *.sty $latex_dir ; then
echo "${tred}Error copying packages! Did you run with sudo?${treset}"
exit
else
echo "Packages copied."
fi
echo "Copying classes..."
if ! cp -v *.cls $latex_dir ; then
echo "${tred}Error copying classes! Did you run with sudo?${treset}"
exit
else
echo "Classes copied"
fi
echo "Updating package cache..."
if ! texhash ; then
echo "${tred}Couldn't update cache${treset}"
else
echo "Package cache updated."
fi
echo "Finished"