From d9170cab22bee570a64507fb08a6f05b8198e208 Mon Sep 17 00:00:00 2001 From: itsmarble <130370814+itsmarble@users.noreply.github.com> Date: Thu, 4 May 2023 20:01:53 +0200 Subject: [PATCH] Update run.sh (#3752) Co-authored-by: Richard Beales --- run.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/run.sh b/run.sh index edcbc44155b9..b4155d8818c8 100755 --- a/run.sh +++ b/run.sh @@ -1,9 +1,25 @@ #!/bin/bash -python scripts/check_requirements.py requirements.txt + +function find_python_command() { + if command -v python &> /dev/null + then + echo "python" + elif command -v python3 &> /dev/null + then + echo "python3" + else + echo "Python not found. Please install Python." + exit 1 + fi +} + +PYTHON_CMD=$(find_python_command) + +$PYTHON_CMD scripts/check_requirements.py requirements.txt if [ $? -eq 1 ] then echo Installing missing packages... - pip install -r requirements.txt + $PYTHON_CMD -m pip install -r requirements.txt fi -python -m autogpt $@ -read -p "Press any key to continue..." +$PYTHON_CMD -m autogpt $@ +read -p "Press any key to continue..." \ No newline at end of file