Skip to content

Commit

Permalink
Installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
AdiChat committed Mar 12, 2024
1 parent 6683268 commit fc60440
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions install-cpp/install-script-unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Function to check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}

# Check if g++ is already installed
if command_exists g++; then
echo "g++ is already installed."
else
# Install g++
sudo apt update
sudo apt install g++

# Check if installation was successful
if command_exists g++; then
echo "g++ has been successfully installed."
else
echo "Failed to install g++."
exit 1
fi
fi

0 comments on commit fc60440

Please sign in to comment.