-
Notifications
You must be signed in to change notification settings - Fork 1
/
check.sh
executable file
·138 lines (117 loc) · 2.61 KB
/
check.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/usr/bin/env bash
GREEN=$(tput setaf 2)
# YELLOW=$(tput setaf 3)
RED=$(tput setaf 1)
NC="$(tput sgr0)"
width=25
errors=0
header() {
printf "\n🔍 %s\n" "$1"
}
checkTools() {
cmd=$1
package=${cmd}
if [ "$2" != "" ]; then
package=$2
fi
if command -v "$cmd" >/dev/null; then
status="[✔️]"
color="$GREEN"
else
errors=1
status="[!]"
color="$RED"
fi
printf "%-${width}s %s%s%s\n" "$package" "$color" "$status" "$NC"
}
echo "🔎 nvim-starter installaction checker 🔎"
header "Requirements"
# checkTools "fzf"
checkTools "cmake"
checkTools "fd"
checkTools "lazygit"
checkTools "make"
checkTools "npm"
checkTools "python"
checkTools "tree-sitter"
checkTools "xclip"
checkTools "yarn"
###############################################################################
# languages support
###############################################################################
#
if [ "$VIDE_ANSIBLE_SUPPORT" == "true" ]; then
header "Ansible support"
checkTools "ansible-lint"
fi
if [ "$VIDE_BASH_SUPPORT" == "true" ]; then
header "Bash support"
checkTools "printenv"
checkTools "shellcheck"
checkTools "shellharden"
fi
if [ "$VIDE_D2_SUPPORT" == "true" ]; then
header "d2 support"
checkTools "d2"
fi
if [ "$VIDE_JSON_SUPPORT" == "true" ]; then
header "JSON support"
checkTools "fixjson"
checkTools "jsonlint"
fi
if [ "$VIDE_LUA_SUPPORT" == "true" ]; then
header "Lua support"
checkTools "lua-format"
checkTools "luacheck"
checkTools "selene"
checkTools "stylua"
fi
if [ "$VIDE_MAKE_SUPPORT" == "true" ]; then
header "Makefile support"
checkTools "checkmake"
fi
if [ "$VIDE_MARKDOWN_SUPPORT" == "true" ]; then
header "Markdown support"
checkTools "markdownlint"
checkTools "marksman"
fi
if [ "$VIDE_NIX_SUPPORT" == "true" ]; then
header "Nix support"
checkTools "alejandra"
checkTools "deadnix"
checkTools "nixfmt"
checkTools "nixpkgs-fmt"
checkTools "statix"
fi
if [ "$VIDE_PYTHON_SUPPORT" == "true" ]; then
header "Python support"
checkTools "autoflake"
checkTools "autopep8"
checkTools "black"
checkTools "mypy"
checkTools "pycodestyle"
checkTools "pydocstyle"
checkTools "pylint"
checkTools "python3"
checkTools "ruff"
checkTools "vulture"
fi
if [ "$VIDE_TERRAFORM_SUPPORT" == "true" ]; then
header "Terraform support"
checkTools "terraform"
checkTools "terraform-ls"
fi
if [ "$VIDE_TEX_SUPPORT" == "true" ]; then
header "tex support"
checkTools "latexindent"
checkTools "pplatex"
checkTools "texlab"
fi
if [ "$VIDE_TYPESCRIPT_SUPPORT" == "true" ]; then
header "Typescript support"
checkTools "deno"
fi
if [ ! "$errors" -eq 0 ]; then
echo "⚠️ Please verify your installation"
exit 1
fi