Skip to content

Commit b50e603

Browse files
committed
chore: rebase with main
1 parent b7c57f8 commit b50e603

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

install.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ venv_dir=".venv"
66
# Find a suitable Python 3.9+ interpreter
77
PYTHON_CMD=""
88
for cmd in python3.12 python3.11 python3.10 python3.9 python3 python; do
9-
if command -v $cmd &> /dev/null; then
10-
version=$($cmd -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" 2>/dev/null)
11-
major=$(echo $version | cut -d '.' -f 1)
12-
minor=$(echo $version | cut -d '.' -f 2)
13-
if [[ "$major" -ge 3 && "$minor" -ge 9 ]]; then
14-
PYTHON_CMD=$cmd
15-
break
16-
fi
9+
if command -v $cmd &>/dev/null; then
10+
version=$($cmd -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" 2>/dev/null)
11+
major=$(echo "$version" | cut -d '.' -f 1)
12+
minor=$(echo "$version" | cut -d '.' -f 2)
13+
if [[ "$major" -ge 3 && "$minor" -ge 9 ]]; then
14+
PYTHON_CMD=$cmd
15+
break
1716
fi
17+
fi
1818
done
1919

2020
if [[ -z "$PYTHON_CMD" ]]; then
21-
echo "Python 3.9 or higher is required but not found."
22-
echo "Please install Python 3.9+ and ensure it's in your PATH."
23-
exit 1
21+
echo "Python 3.9 or higher is required but not found."
22+
echo "Please install Python 3.9+ and ensure it's in your PATH."
23+
exit 1
2424
fi
2525

2626
echo "Using Python: $PYTHON_CMD ($(${PYTHON_CMD} --version))"
2727

2828
# Create virtual environment if it doesn't exist
2929
if [[ ! -d "$venv_dir" ]]; then
30-
echo "Creating virtual environment in $venv_dir..."
31-
$PYTHON_CMD -m venv $venv_dir
30+
echo "Creating virtual environment in $venv_dir..."
31+
$PYTHON_CMD -m venv $venv_dir
3232
fi
3333

3434
# Activate virtual environment and install dependencies
35-
source $venv_dir/bin/activate
35+
# shellcheck source=/dev/null
36+
source "$venv_dir/bin/activate"
3637
echo "Virtual environment activated"
3738

38-
cd $folder
39+
cd $folder || exit
3940
pip install -r requirements.txt
4041
python main.py
41-

0 commit comments

Comments
 (0)