21 lines
543 B
Bash
Executable File
21 lines
543 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
cd "$(dirname "$0")"
|
|
|
|
# Python Homebrew en priorité (le python système 3.9 est trop vieux pour Playwright récent)
|
|
if [ -x /opt/homebrew/bin/python3 ]; then
|
|
PY=/opt/homebrew/bin/python3
|
|
else
|
|
PY=$(command -v python3)
|
|
fi
|
|
|
|
if [ ! -d .venv ]; then
|
|
echo "Première installation (environnement Python + Chromium), patientez quelques minutes..."
|
|
"$PY" -m venv .venv
|
|
.venv/bin/pip install --upgrade pip
|
|
.venv/bin/pip install -r requirements.txt
|
|
.venv/bin/playwright install chromium
|
|
fi
|
|
|
|
exec .venv/bin/python app.py
|