-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathzsh
executable file
·40 lines (33 loc) · 1002 Bytes
/
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
#!/usr/bin/env bash
source "$DOTFILES_PATH/scripts/core/_main.sh"
##? ZSH helpers
#?? 1.0.0
##?
##? Usage:
##? zsh optimize # Optimize ZSH
##? zsh test_performance # Print the current ZSH performance
##? zsh reload_completions # Print the current ZSH performance
docs::eval_help "$@"
case $1 in
"optimize")
find "$DOTFILES_PATH/terminal/zsh" -name '*.zwc' -exec rm -rf {} \;
find "$DOTFILES_PATH/terminal/zsh" -name '*.old' -exec rm -rf {} \;
/bin/zsh -c "source ${ZDOTDIR:-${HOME}}/.zlogin"
echo "👌 Done!"
;;
"test_performance")
echo "🍎 With native macOS ZSH"
/bin/zsh --version
for i in $(seq 1 10); do /usr/bin/time /bin/zsh -i -c exit; done
echo "🍻 With Brew ZSH"
/usr/local/bin/zsh --version
for i in $(seq 1 10); do /usr/bin/time /usr/local/bin/zsh -i -c exit; done
;;
"reload_completions")
/bin/zsh -c "autoload -U compaudit && autoload -Uz compinit && compinit"
echo "👌 Done!"
;;
*)
docs::eval_help --help
;;
esac