From 1e44aaab9d4890cdd12b5aa5b7b1c96253e9e287 Mon Sep 17 00:00:00 2001 From: trnq1ll0 Date: Tue, 9 Jun 2026 10:17:14 +0200 Subject: [PATCH] erzeuge macos start.command --- start.command | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 start.command diff --git a/start.command b/start.command new file mode 100755 index 0000000..f655147 --- /dev/null +++ b/start.command @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Doppelklickbares Start-Script für macOS (.command wird von Finder automatisch im Terminal geöffnet) + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$SCRIPT_DIR" + +echo "========================================" +echo " Tätigkeitsnachweis-Generator" +echo "========================================" +echo "" + +if command -v python3 >/dev/null 2>&1; then + PYTHON_BIN="python3" +elif command -v python >/dev/null 2>&1; then + PYTHON_BIN="python" +else + echo "[FEHLER] Python wurde nicht gefunden." + echo "Bitte installiere Python 3.9+ von https://python.org" + read -p "Drücke Enter zum Beenden..." + exit 1 +fi + +echo "[INFO] Python: $("$PYTHON_BIN" --version)" + +VENV_DIR=".venv" +if [[ ! -x "$VENV_DIR/bin/python" ]]; then + if [[ -d "$VENV_DIR" ]]; then + echo "[INFO] Erstelle venv neu..." + rm -rf "$VENV_DIR" + fi + echo "[INFO] Erstelle virtuelle Umgebung..." + "$PYTHON_BIN" -m venv "$VENV_DIR" +fi + +echo "[INFO] Installiere Abhängigkeiten..." +"$VENV_DIR/bin/pip" install -r requirements.txt --quiet + +echo "" +echo "[INFO] Starte Tätigkeitsnachweis-Generator..." +echo "[INFO] Browser: http://localhost:8501" +echo "" +"$VENV_DIR/bin/streamlit" run app.py + +read -p "Drücke Enter zum Beenden..."