From 7bf912f40740b4cca62ddc65bd82700615636550 Mon Sep 17 00:00:00 2001 From: Maxime Desroches Date: Wed, 31 Jul 2024 21:40:48 -0700 Subject: [PATCH] op.sh: fix python version check (#33163) fix check --- tools/op.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/op.sh b/tools/op.sh index ec4728ddf1ca9b..1715aaab633bf0 100755 --- a/tools/op.sh +++ b/tools/op.sh @@ -115,7 +115,7 @@ function op_check_python() { if [[ -z $INSTALLED_PYTHON_VERSION ]]; then echo -e " ↳ [${RED}✗${NC}] python3 not found on your system. You need python version at least $(echo $REQUIRED_PYTHON_VERSION | tr -d -c '[0-9.]') to continue!" return 1 - elif [[ $(echo $INSTALLED_PYTHON_VERSION | tr -d -c '[0-9]') -ge $(($(echo $REQUIRED_PYTHON_VERSION | tr -d -c '[0-9]') * 10)) ]]; then + elif [[ $(echo $INSTALLED_PYTHON_VERSION | grep -o '[0-9]\+\.[0-9]\+' | tr -d -c '[0-9]') -ge $(echo $REQUIRED_PYTHON_VERSION | tr -d -c '[0-9]') ]]; then echo -e " ↳ [${GREEN}✔${NC}] $INSTALLED_PYTHON_VERSION detected." else echo -e " ↳ [${RED}✗${NC}] You need python version at least $(echo $REQUIRED_PYTHON_VERSION | tr -d -c '[0-9.]') to continue!"