-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·49 lines (40 loc) · 1.16 KB
/
install.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
#!/bin/sh
GREEN='\033[0;32m'
RED='\033[0;31m'
NO_COLOR='\033[0m'
OK="${GREEN}OK${NO_COLOR}"
ERR="${RED}Err${NO_COLOR}"
check_dependencies() {
local required=("nvim" "node" "npm" "gcc")
local missing_deps=()
for dep in "${required[@]}"; do
if ! command -v "$dep" >/dev/null 2>&1; then
missing_deps+=("$dep")
fi
done
if [ ${#missing_deps[@]} -eq 0 ]; then
echo -e "${OK}"
else
echo -e "${ERR}"
echo "Dependencies missing:"
for dep in "${missing_deps[@]}"; do
echo -e "\t- $dep"
done
exit 1
fi
}
echo -n "Checking dependencies... "
check_dependencies
echo -n "Installing plugins with Packer... "
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerInstall' 2>/dev/null && \
echo -e "${OK}"
echo -n "Syncing plugins with Packer... "
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync' 2>/dev/null && \
echo -e "${OK}"
echo -n "Updating treesitter... "
nvim --headless -c ':TSUpdate' -c 'qa' 2>/dev/null && \
echo -e "${OK}"
echo -n "Setting undo config... "
sed -i "s/nithe/$USER/g" ~/.config/nvim/lua/variables.lua && \
echo -e "${OK}"
echo