From 4887be7b310667ab9441aa4d77de14f9443935ab Mon Sep 17 00:00:00 2001 From: i-defranca Date: Thu, 2 Apr 2026 12:32:19 -0300 Subject: [PATCH] fix: replace string match with regex for Compose version --- install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 68333aaf..7b915da0 100644 --- a/install.sh +++ b/install.sh @@ -85,11 +85,13 @@ do_install () { fi composeVersion=$(docker compose version || true) - if [[ ! "$composeVersion" == *"Docker Compose version v2"* ]]; then - builtin echo -e "${start_error}We could not identify Composer V2 installed.${end_error}" - builtin echo -e "Please make sure you are running an updated Docker version that includes Compose V2:" + regex="Docker Compose version v?([25]|[1-9][0-9]+)\." + + if [[ ! "$composeVersion" =~ $regex ]]; then + builtin echo -e "${start_error}We could not identify a valid Composer version installed.${end_error}" + builtin echo -e "Please make sure you are running an updated Docker version that includes Compose V2 or V5:" builtin echo -e " Official Docker installation documentation: https://docs.docker.com/get-docker/" - builtin echo -e " Official Docker Compose V2 documentation: https://docs.docker.com/compose/reference/" + builtin echo -e " Official Docker Compose documentation: https://docs.docker.com/compose/reference/" exit fi