Files
agent_v0/build.sh
2026-03-05 00:20:23 +01:00

40 lines
891 B
Bash
Executable File

#!/usr/bin/env bash
set -e
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$BASE_DIR"
echo "[agent_v0] Build depuis : $BASE_DIR"
# 1) Activer le venv
if [ ! -d ".venv" ]; then
echo "[agent_v0] Pas de .venv trouvé. Lance d'abord ./run.sh une fois pour le créer."
exit 1
fi
# shellcheck disable=SC1091
source .venv/bin/activate
echo "[agent_v0] Python : $(which python)"
# 2) Vérifier / installer pyinstaller
if ! command -v pyinstaller >/dev/null 2>&1; then
echo "[agent_v0] Installation de pyinstaller..."
pip install pyinstaller
fi
# 3) Nettoyage build précédent
rm -rf build dist *.spec
# 4) Build
echo "[agent_v0] Lancement de PyInstaller..."
pyinstaller \
--name agent_v0_tray \
--onefile \
--noconfirm \
--paths "$BASE_DIR" \
main.py
echo "[agent_v0] Build terminé."
echo "[agent_v0] Binaire disponible dans : $BASE_DIR/dist/agent_v0_tray"