-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·37 lines (31 loc) · 1.11 KB
/
setup.sh
File metadata and controls
executable file
·37 lines (31 loc) · 1.11 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
#!/bin/bash
# Exit script on any error
set -e
# Function to check if a tool is installed
check_and_install() {
local tool=$1
local install_command=$2
if command -v $tool >/dev/null 2>&1; then
echo "$tool is already installed."
else
read -p "$tool is not installed. Do you want to install it? (y/n): " response
if [[ $response == "y" || $response == "Y" ]]; then
echo "Installing $tool..."
eval $install_command
else
echo "Skipping $tool installation."
fi
fi
}
# Update package lists
echo "Updating package lists..."
sudo apt update
# Check and install tools
check_and_install "make" "sudo apt install -y make"
check_and_install "gcc" "sudo apt install -y gcc"
check_and_install "libcunit1" "sudo apt-get install -y libcunit1 libcunit1-doc libcunit1-dev"
check_and_install "valgrind" "sudo apt install -y valgrind"
check_and_install "clang-tidy" "sudo apt install -y clang-tidy"
check_and_install "clang-format-15" "sudo apt-get install -y clang-format-15"
check_and_install "clang" "sudo apt install -y clang"
echo "Setup completed."