-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequirements.sh
More file actions
executable file
·59 lines (54 loc) · 1.71 KB
/
requirements.sh
File metadata and controls
executable file
·59 lines (54 loc) · 1.71 KB
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
#!/bin/bash
# Description: Install required packages for building the project
green='\033[0;32m'
red='\033[0;31m'
reset='\033[0m'
printf "%b\n" "${green}~ Requirements check:"
# Check if cmake is installed
if command -v cmake &> /dev/null
then
printf "%b %s\n" "${green}\u2714${reset}" "cmake is already installed"
else
printf "%b %s\n" "${red}\u00D7${reset}" "CMake is not installed. Do you want to install it? (y/n)"
read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "Installing cmake..."
sudo apt update -qq
sudo apt install cmake -qq -y
else
echo "CMake is required to build the project. Exiting..."
exit 1
fi
fi
# Check if ninja-build is installed
if command -v ninja &> /dev/null
then
printf "%b %s\n" "${green}\u2714${reset}" "ninja-build is already installed"
else
printf "%b %s\n" "${red}\u00D7${reset}" "ninja-build is not installed. Do you want to install it? (y/n)"
read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "Installing ninja-build..."
sudo apt update -qq
sudo apt install ninja-build -qq -y
else
echo "ninja-build is required to build the project. Exiting..."
exit 1
fi
fi
# Check if fzf is installed
if command -v fzf &> /dev/null
then
printf "%b %s\n" "${green}\u2714${reset}" "fzf is already installed"
else
printf "%b %s\n" "${red}\u00D7${reset}" "fzf is not installed. Do you want to install it? (y/n)"
read -r answer
if [ "$answer" != "${answer#[Yy]}" ] ;then
echo "Installing fzf..."
sudo apt update -qq
sudo apt install fzf -qq -y
else
echo "fzf is required to build the project. Exiting..."
exit 1
fi
fi