-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install_dep.sh
executable file
·158 lines (99 loc) · 2.83 KB
/
Install_dep.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash
# SUPPORTED DISTROS:
# Fedora
# Ubuntu
# Debian
# Arch Linux
# DEPENDENCIES VERSION
NODE_VERSION=22
DOTNET_VERSION=8.0
GRANTED=false
echo "======================| KEBABVIM |==========================="
# Get user permissions!
echo "WARNING: DEFAULT IS (NO)"
read -p "Sudo permissions are required for this bash script. Allow sudo permissions? (Y/N): " Perms
if [[ ! $Perms =~ ^[Yy][Ee]?[Ss]?$ ]]; then
echo "Permission's denied unable to go forward! exit 0"
exit 0
fi
echo "Permission's granted installing dependencies!"
# INSTALL GIT
if ! command -v git &> /dev/null; then
if [ -f /etc/redhat-release ]; then
sudo dnf install git -y
elif [ -f /etc/lsb-release ]; then
sudo apt-get install git -y
elif [ -f /etc/debian_version ]; then
sudo apt-get install git -y
elif [ -f /etc/arch-release ]; then
sudo pacman -Syu git --noconfirm
else
echo "UNSUPPORTED DISTRO! UNABLE TO INSTALL CURL. PLEASE INSTALL CURL!"
exit 1
fi
if ! command -v git &> /dev/null; then
echo "Failed to install git!"
exit 1
fi
fi
# INSTALL CURL
if ! command -v curl &> /dev/null; then
if [ -f /etc/redhat-release ]; then
sudo dnf install curl -y
elif [ -f /etc/lsb-release ]; then
sudo apt-get install curl -y
elif [ -f /etc/debian_version ]; then
sudo apt-get install curl -y
elif [ -f /etc/arch-release ]; then
sudo pacman -Syu curl --noconfirm
else
echo "UNSUPPORTED DISTRO! UNABLE TO INSTALL CURL. PLEASE INSTALL CURL!"
exit 1
fi
if ! command -v curl &> /dev/null; then
echo "Failed to install curl!"
exit 1
fi
fi
# INSTALL NODE JS & NPM !!
if ! command -v node &> /dev/null; then
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install $NODE_VERSION
fi
# INSTALL PRETTIER
sudo npm install -g prettier
# INSTALL STYLUA
sudo npm i -g @johnnymorganz/stylua-bin
# INSTALL WGET
if ! command -v wget &> /dev/null; then
if [ -f /etc/redhat-release ]; then
sudo dnf install wget -y
elif [ -f /etc/lsb-release ]; then
sudo apt-get install wget -y
elif [ -f /etc/debian_version ]; then
sudo apt-get install wget -y
elif [ -f /etc/arch-release ]; then
sudo pacman -Syu wget --noconfirm
else
echo "UNSUPPORTED DISTRO! UNABLE TO INSTALL WGET. PLEASE INSTALL WGET!"
exit 1
fi
if ! command -v wget &> /dev/null; then
echo "Failed to install wget!"
exit 1
fi
fi
# Install dotnet!
if ! command -v dotnet &> /dev/null; then
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
if [ -f ./dotnet-install.sh ]; then
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel $DOTNET_VERSION
./dotnet-install.sh --channel $DOTNET_VERSION --runtime aspnetcore
# CLEAN UP
test -f ./dotnet-install.sh && rm ./dotnet-install.sh
fi
fi
echo "ALL DEPENDENCIES SHOULD BE INSTALLED!"
exit 0