-
Notifications
You must be signed in to change notification settings - Fork 1
/
ox-pkg-tlmgr.sh
59 lines (47 loc) · 1.56 KB
/
ox-pkg-tlmgr.sh
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
52
53
54
55
56
57
58
59
#!/bin/bash /bin/zsh
##########################################################
# config
##########################################################
# backup files
if [[ ! -d "${OX_BACKUP}"/text ]]; then
mkdir -p -v "${OX_BACKUP}"/text
fi
OX_OXIDE[bktl]=${OX_BACKUP}/text/texlive-pkgs.txt
if [[ $(uname) = "Darwin" ]]; then
export texlive=/usr/local/texlive
fi
# bin
eval "$(/usr/libexec/path_helper)"
up_texlive() {
echo "Update TeXLive by ${OX_OXIDE[bktl]}"
num=$(wc -l <"${OX_OXIDE[bktl]}" | rg -o "\d+")
pueue group add texlive_update
pueue parallel "$num" -g texlive_update
while read -r line <"${OX_OXIDE[bktl]}"; do
echo "Installing $line"
pueue add -g texlive_update "tlmgr install $line"
done
pueue wait -g texlive_update
pueue status
}
back_texlive() {
echo "Backup TeXLive to ${OX_OXIDE[bktl]}"
tlmgr list --only-installed | rg -o "collection-\w+" | rg -v "basic" >"${OX_OXIDE[bktl]}"
}
##########################################################
# packages
##########################################################
alias tlup="sudo tlmgr update --all"
alias tlups="sudo tlmgr update --all --self"
alias tlck="sudo tlmgr check"
alias tlis="sudo tlmgr install"
alias tlus="sudo tlmgr remove && tlmgr check"
##########################################################
# info
##########################################################
alias tllsa="tlmgr list"
alias tlls="tlmgr list --only-installed"
alias tlif="tlmgr info"
alias tlifc="tlmgr info collections"
alias tlifs="tlmgr info schemes"
alias tlh="tlmgr -h"