From 448779fd7e51178faa929280a867a67492bf3026 Mon Sep 17 00:00:00 2001 From: Yuri Lima Date: Tue, 2 Sep 2025 17:10:34 +0200 Subject: [PATCH] Add Git installation check to Docker installation script --- basic-instalations.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/basic-instalations.sh b/basic-instalations.sh index e8c4185..7fbf4e3 100755 --- a/basic-instalations.sh +++ b/basic-instalations.sh @@ -9,9 +9,22 @@ is_wsl() { grep -qi microsoft /proc/version 2>/dev/null } +check_git_installed() { + if ! command -v git &> /dev/null; then + echo "🔍 Git not found, installing..." + sudo apt-get update + sudo apt-get install -y git + echo "✅ Git installed successfully!" + else + echo "✔️ Git is already installed: $(git --version)" + fi +} + install_docker_linux() { echo "🔧 Installing Docker on Linux..." + check_git_installed + # Remove old versions sudo apt-get remove -y docker docker-engine docker.io containerd runc || true