33 lines
798 B
Bash
33 lines
798 B
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# Gestionnaire d'immobilisations — lancement rapide (Mac / Linux)
|
||
|
|
set -e
|
||
|
|
cd "$(dirname "$0")"
|
||
|
|
|
||
|
|
if [ ! -d ".venv" ]; then
|
||
|
|
echo "Première utilisation : création de l'environnement Python..."
|
||
|
|
python3 -m venv .venv
|
||
|
|
fi
|
||
|
|
|
||
|
|
.venv/bin/pip install -q -r requirements.txt
|
||
|
|
|
||
|
|
mkdir -p data
|
||
|
|
export IMMOS_DB_PATH="$(pwd)/data/immos.db"
|
||
|
|
|
||
|
|
PORT=8001
|
||
|
|
URL="http://localhost:$PORT"
|
||
|
|
|
||
|
|
echo ""
|
||
|
|
echo " Gestionnaire d'immobilisations — Chezlepro Inc."
|
||
|
|
echo " Ouvre $URL dans ton navigateur."
|
||
|
|
echo " Ctrl+C pour arrêter."
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
# Ouvre le navigateur automatiquement (Mac et Linux)
|
||
|
|
if command -v open &>/dev/null; then
|
||
|
|
sleep 1 && open "$URL" &
|
||
|
|
elif command -v xdg-open &>/dev/null; then
|
||
|
|
sleep 1 && xdg-open "$URL" &
|
||
|
|
fi
|
||
|
|
|
||
|
|
.venv/bin/uvicorn app.main:app --host 0.0.0.0 --port $PORT
|