-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathssr
executable file
·75 lines (63 loc) · 1.1 KB
/
ssr
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
COLOR_RESET=$(tput sgr0)
COLOR_RED=$(tput setaf 1)
COLOR_GREEN=$(tput setaf 2)
#-------------------------------------------------
i=0
n=2
check_bin() {
local bin_name=$1
local pkg_name=${2:-$1}
if command -v "$bin_name" > /dev/null; then
echo -n "[$COLOR_GREEN OK $COLOR_RESET]"
else
echo -n "[$COLOR_RED FAIL $COLOR_RESET]"
fi
printf " %-21s" "$pkg_name"
i=$((i + 1))
if [ "$i" -ge "$n" ]; then
i=0
echo
fi
}
flush() {
if [ "$i" != 0 ]; then
i=0
echo
fi
echo
}
#-------------------------------------------------
# cli
check_bin tmux
check_bin rg ripgrep
check_bin fzf
check_bin parallel
check_bin curl
check_bin gpg
check_bin pwgen
check_bin qrencode
check_bin utimer
flush
# data
check_bin jq
check_bin xsv
flush
# experimental
check_bin nvim "neovim"
check_bin htop
check_bin duf
check_bin dust
check_bin pstree
check_bin cloc
check_bin socat
flush
# dev
check_bin jsonlint "jsonlint @ npm"
check_bin fixjson "fixjson @ npm"
check_bin stylua
check_bin shellcheck
check_bin yamllint
check_bin pg_format pgformatter
check_bin entr
flush