🔧 Aktualisiert: setup.sh zur Unterstützung der intelligenten Pfad-Erkennung und Anpassung an Git-Clone-Umgebungen, einschließlich verbesserter Logging-Mechanismen und robustem Deployment-Prozess. 🚀
This commit is contained in:
172
backend/setup.sh
172
backend/setup.sh
@@ -22,7 +22,39 @@ readonly WATCHDOG_SERVICE_NAME="kiosk-watchdog"
|
|||||||
readonly WATCHDOG_PYTHON_SERVICE_NAME="kiosk-watchdog-python"
|
readonly WATCHDOG_PYTHON_SERVICE_NAME="kiosk-watchdog-python"
|
||||||
readonly FIREWALL_SERVICE_NAME="myp-firewall"
|
readonly FIREWALL_SERVICE_NAME="myp-firewall"
|
||||||
readonly KIOSK_USER="kiosk"
|
readonly KIOSK_USER="kiosk"
|
||||||
readonly CURRENT_DIR="$(pwd)"
|
|
||||||
|
# =========================== INTELLIGENTE PFAD-ERKENNUNG ===========================
|
||||||
|
# Erkenne ob Skript im Git-Clone (backend/) oder Produktions-Verzeichnis läuft
|
||||||
|
detect_script_location() {
|
||||||
|
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
local script_basename="$(basename "$script_dir")"
|
||||||
|
|
||||||
|
if [[ "$script_basename" == "backend" ]]; then
|
||||||
|
# Skript läuft im Git-Clone backend/ Verzeichnis
|
||||||
|
readonly GIT_CLONE_MODE=true
|
||||||
|
readonly CURRENT_DIR="$script_dir"
|
||||||
|
readonly SOURCE_BACKEND_DIR="$script_dir"
|
||||||
|
readonly PROJECT_ROOT_DIR="$(dirname "$script_dir")"
|
||||||
|
|
||||||
|
log "🔍 GIT-CLONE-MODUS ERKANNT"
|
||||||
|
log " 📁 Skript-Verzeichnis: $CURRENT_DIR"
|
||||||
|
log " 📁 Backend-Quelle: $SOURCE_BACKEND_DIR"
|
||||||
|
log " 📁 Projekt-Root: $PROJECT_ROOT_DIR"
|
||||||
|
log " 🎯 Ziel: $APP_DIR"
|
||||||
|
else
|
||||||
|
# Skript läuft bereits im Produktions-Verzeichnis
|
||||||
|
readonly GIT_CLONE_MODE=false
|
||||||
|
readonly CURRENT_DIR="$script_dir"
|
||||||
|
readonly SOURCE_BACKEND_DIR="$script_dir"
|
||||||
|
readonly PROJECT_ROOT_DIR="$script_dir"
|
||||||
|
|
||||||
|
log "🏠 PRODUKTIONS-MODUS ERKANNT"
|
||||||
|
log " 📁 Produktions-Verzeichnis: $CURRENT_DIR"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Führe Pfad-Erkennung aus
|
||||||
|
detect_script_location
|
||||||
|
|
||||||
# Automatische Installationsmodus-Erkennung
|
# Automatische Installationsmodus-Erkennung
|
||||||
AUTO_INSTALL_MODE=""
|
AUTO_INSTALL_MODE=""
|
||||||
@@ -60,8 +92,8 @@ load_dynamic_credentials() {
|
|||||||
MYP_GITHUB_CLIENT_ID="${MYP_GITHUB_CLIENT_ID_OVERRIDE:-$MYP_GITHUB_CLIENT_ID}"
|
MYP_GITHUB_CLIENT_ID="${MYP_GITHUB_CLIENT_ID_OVERRIDE:-$MYP_GITHUB_CLIENT_ID}"
|
||||||
MYP_GITHUB_CLIENT_SECRET="${MYP_GITHUB_CLIENT_SECRET_OVERRIDE:-$MYP_GITHUB_CLIENT_SECRET}"
|
MYP_GITHUB_CLIENT_SECRET="${MYP_GITHUB_CLIENT_SECRET_OVERRIDE:-$MYP_GITHUB_CLIENT_SECRET}"
|
||||||
|
|
||||||
# Credentials aus externer Datei laden (falls vorhanden)
|
# Credentials aus externer Datei laden (Git-Clone-bewusst)
|
||||||
local credentials_file="$CURRENT_DIR/CREDENTIALS_OVERRIDE.env"
|
local credentials_file="$SOURCE_BACKEND_DIR/CREDENTIALS_OVERRIDE.env"
|
||||||
if [ -f "$credentials_file" ]; then
|
if [ -f "$credentials_file" ]; then
|
||||||
progress "Lade Credentials aus: $credentials_file"
|
progress "Lade Credentials aus: $credentials_file"
|
||||||
source "$credentials_file"
|
source "$credentials_file"
|
||||||
@@ -170,7 +202,7 @@ interactive_credentials_setup() {
|
|||||||
|
|
||||||
# Funktion: Credentials in Override-Datei speichern
|
# Funktion: Credentials in Override-Datei speichern
|
||||||
save_credentials_override() {
|
save_credentials_override() {
|
||||||
local override_file="$CURRENT_DIR/CREDENTIALS_OVERRIDE.env"
|
local override_file="$SOURCE_BACKEND_DIR/CREDENTIALS_OVERRIDE.env"
|
||||||
|
|
||||||
progress "Speichere Credentials-Override in: $override_file"
|
progress "Speichere Credentials-Override in: $override_file"
|
||||||
cat > "$override_file" << EOF
|
cat > "$override_file" << EOF
|
||||||
@@ -430,13 +462,13 @@ validate_credentials_comprehensive() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# =========================== LOG-DATEIEN INITIALISIERUNG ===========================
|
# =========================== LOG-DATEIEN INITIALISIERUNG ===========================
|
||||||
# Log-Dateien - verwende relatives logs-Verzeichnis (falls noch nicht definiert)
|
# Log-Dateien - verwende relatives logs-Verzeichnis (Git-Clone-bewusst)
|
||||||
if [ -z "$INSTALL_LOG" ]; then
|
if [ -z "$INSTALL_LOG" ]; then
|
||||||
mkdir -p "$CURRENT_DIR/logs" 2>/dev/null || true
|
mkdir -p "$SOURCE_BACKEND_DIR/logs" 2>/dev/null || true
|
||||||
INSTALL_LOG="$CURRENT_DIR/logs/install.log"
|
INSTALL_LOG="$SOURCE_BACKEND_DIR/logs/install.log"
|
||||||
ERROR_LOG="$CURRENT_DIR/logs/errors.log"
|
ERROR_LOG="$SOURCE_BACKEND_DIR/logs/errors.log"
|
||||||
WARNING_LOG="$CURRENT_DIR/logs/warnings.log"
|
WARNING_LOG="$SOURCE_BACKEND_DIR/logs/warnings.log"
|
||||||
DEBUG_LOG="$CURRENT_DIR/logs/debug.log"
|
DEBUG_LOG="$SOURCE_BACKEND_DIR/logs/debug.log"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# =========================== VERBESSERTE LOGGING-FUNKTIONEN ===========================
|
# =========================== VERBESSERTE LOGGING-FUNKTIONEN ===========================
|
||||||
@@ -446,8 +478,8 @@ WARNING_COUNT=0
|
|||||||
|
|
||||||
# Log-Dateien initialisieren
|
# Log-Dateien initialisieren
|
||||||
init_logging() {
|
init_logging() {
|
||||||
# Sichere Log-Verzeichnis-Erstellung
|
# Sichere Log-Verzeichnis-Erstellung (Git-Clone-bewusst)
|
||||||
if ! mkdir -p "$CURRENT_DIR/logs" 2>/dev/null; then
|
if ! mkdir -p "$SOURCE_BACKEND_DIR/logs" 2>/dev/null; then
|
||||||
echo "FEHLER: Kann logs-Verzeichnis nicht erstellen - verwende /tmp" >&2
|
echo "FEHLER: Kann logs-Verzeichnis nicht erstellen - verwende /tmp" >&2
|
||||||
INSTALL_LOG="/tmp/myp-install.log"
|
INSTALL_LOG="/tmp/myp-install.log"
|
||||||
ERROR_LOG="/tmp/myp-install-errors.log"
|
ERROR_LOG="/tmp/myp-install-errors.log"
|
||||||
@@ -461,7 +493,10 @@ init_logging() {
|
|||||||
echo "MYP Installation Log - $(date '+%Y-%m-%d %H:%M:%S')"
|
echo "MYP Installation Log - $(date '+%Y-%m-%d %H:%M:%S')"
|
||||||
echo "Script Version: $APP_VERSION"
|
echo "Script Version: $APP_VERSION"
|
||||||
echo "System: $(timeout 5 uname -a 2>/dev/null || echo 'System-Info nicht verfügbar')"
|
echo "System: $(timeout 5 uname -a 2>/dev/null || echo 'System-Info nicht verfügbar')"
|
||||||
|
echo "Git-Clone-Modus: $GIT_CLONE_MODE"
|
||||||
|
echo "Backend-Quelle: $SOURCE_BACKEND_DIR"
|
||||||
echo "Arbeitsverzeichnis: $CURRENT_DIR"
|
echo "Arbeitsverzeichnis: $CURRENT_DIR"
|
||||||
|
echo "Ziel-Verzeichnis: $APP_DIR"
|
||||||
echo "Log-Verzeichnis: $(dirname "$INSTALL_LOG")"
|
echo "Log-Verzeichnis: $(dirname "$INSTALL_LOG")"
|
||||||
echo "================================================================="
|
echo "================================================================="
|
||||||
echo ""
|
echo ""
|
||||||
@@ -1356,8 +1391,8 @@ EOF
|
|||||||
create_clean_requirements() {
|
create_clean_requirements() {
|
||||||
log "=== ERSTELLE BEREINIGTE REQUIREMENTS.TXT ==="
|
log "=== ERSTELLE BEREINIGTE REQUIREMENTS.TXT ==="
|
||||||
|
|
||||||
local original_req="$CURRENT_DIR/requirements.txt"
|
local original_req="$SOURCE_BACKEND_DIR/requirements.txt"
|
||||||
local clean_req="$CURRENT_DIR/requirements_clean.txt"
|
local clean_req="$SOURCE_BACKEND_DIR/requirements_clean.txt"
|
||||||
|
|
||||||
# Problematische Pakete, die übersprungen werden sollen
|
# Problematische Pakete, die übersprungen werden sollen
|
||||||
local problematic_packages=(
|
local problematic_packages=(
|
||||||
@@ -1493,7 +1528,7 @@ install_python_packages() {
|
|||||||
local install_success=false
|
local install_success=false
|
||||||
|
|
||||||
# Strategie 1: Bereinigte requirements.txt mit --break-system-packages
|
# Strategie 1: Bereinigte requirements.txt mit --break-system-packages
|
||||||
if python3 -m pip install -r "$CURRENT_DIR/requirements_clean.txt" --break-system-packages --no-cache-dir; then
|
if python3 -m pip install -r "$SOURCE_BACKEND_DIR/requirements_clean.txt" --break-system-packages --no-cache-dir; then
|
||||||
install_success=true
|
install_success=true
|
||||||
success "✅ Bereinigte requirements.txt erfolgreich installiert"
|
success "✅ Bereinigte requirements.txt erfolgreich installiert"
|
||||||
else
|
else
|
||||||
@@ -1506,7 +1541,7 @@ install_python_packages() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Aufräumen
|
# Aufräumen
|
||||||
rm -f "$CURRENT_DIR/requirements_clean.txt" 2>/dev/null || true
|
rm -f "$SOURCE_BACKEND_DIR/requirements_clean.txt" 2>/dev/null || true
|
||||||
|
|
||||||
# Validiere essenzielle Module
|
# Validiere essenzielle Module
|
||||||
progress "Validiere essenzielle Python-Module..."
|
progress "Validiere essenzielle Python-Module..."
|
||||||
@@ -1555,13 +1590,13 @@ install_python_packages_with_break_system() {
|
|||||||
|
|
||||||
progress "Installiere Python-Pakete mit --break-system-packages..."
|
progress "Installiere Python-Pakete mit --break-system-packages..."
|
||||||
|
|
||||||
if [ ! -f "$CURRENT_DIR/requirements.txt" ]; then
|
if [ ! -f "$SOURCE_BACKEND_DIR/requirements.txt" ]; then
|
||||||
error "requirements.txt nicht gefunden: $CURRENT_DIR/requirements.txt"
|
error "requirements.txt nicht gefunden: $SOURCE_BACKEND_DIR/requirements.txt"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Kopiere requirements.txt
|
# Kopiere requirements.txt
|
||||||
cp "$CURRENT_DIR/requirements.txt" "$APP_DIR/" 2>/dev/null || true
|
cp "$SOURCE_BACKEND_DIR/requirements.txt" "$APP_DIR/" 2>/dev/null || true
|
||||||
|
|
||||||
# Installiere alle Pakete aus requirements.txt mit --break-system-packages
|
# Installiere alle Pakete aus requirements.txt mit --break-system-packages
|
||||||
progress "Installiere requirements.txt mit --break-system-packages..."
|
progress "Installiere requirements.txt mit --break-system-packages..."
|
||||||
@@ -1570,12 +1605,12 @@ install_python_packages_with_break_system() {
|
|||||||
local install_success=false
|
local install_success=false
|
||||||
|
|
||||||
# Erstelle bereinigte requirements.txt für Installation
|
# Erstelle bereinigte requirements.txt für Installation
|
||||||
if [ ! -f "$CURRENT_DIR/requirements_clean.txt" ]; then
|
if [ ! -f "$SOURCE_BACKEND_DIR/requirements_clean.txt" ]; then
|
||||||
create_clean_requirements
|
create_clean_requirements
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Strategie 1: Mit --break-system-packages und bereinigter requirements.txt
|
# Strategie 1: Mit --break-system-packages und bereinigter requirements.txt
|
||||||
if python3.11 -m pip install -r "$CURRENT_DIR/requirements_clean.txt" --break-system-packages --force-reinstall --no-cache-dir; then
|
if python3.11 -m pip install -r "$SOURCE_BACKEND_DIR/requirements_clean.txt" --break-system-packages --force-reinstall --no-cache-dir; then
|
||||||
install_success=true
|
install_success=true
|
||||||
success "✅ Bereinigte requirements.txt mit --break-system-packages erfolgreich installiert"
|
success "✅ Bereinigte requirements.txt mit --break-system-packages erfolgreich installiert"
|
||||||
else
|
else
|
||||||
@@ -1585,7 +1620,7 @@ install_python_packages_with_break_system() {
|
|||||||
progress "Installiere bereinigte Pakete einzeln..."
|
progress "Installiere bereinigte Pakete einzeln..."
|
||||||
|
|
||||||
# Erstelle bereinigte requirements.txt falls nicht vorhanden
|
# Erstelle bereinigte requirements.txt falls nicht vorhanden
|
||||||
if [ ! -f "$CURRENT_DIR/requirements_clean.txt" ]; then
|
if [ ! -f "$SOURCE_BACKEND_DIR/requirements_clean.txt" ]; then
|
||||||
create_clean_requirements
|
create_clean_requirements
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1607,10 +1642,10 @@ install_python_packages_with_break_system() {
|
|||||||
warning "⚠️ $package_name Installation fehlgeschlagen"
|
warning "⚠️ $package_name Installation fehlgeschlagen"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$CURRENT_DIR/requirements_clean.txt"
|
done < "$SOURCE_BACKEND_DIR/requirements_clean.txt"
|
||||||
|
|
||||||
# Aufräumen
|
# Aufräumen
|
||||||
rm -f "$CURRENT_DIR/requirements_clean.txt" 2>/dev/null || true
|
rm -f "$SOURCE_BACKEND_DIR/requirements_clean.txt" 2>/dev/null || true
|
||||||
install_success=true
|
install_success=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -3247,42 +3282,61 @@ EOF' || warning "SSL-Umgebungsvariablen timeout"
|
|||||||
deploy_application() {
|
deploy_application() {
|
||||||
log "=== ROBUSTES ANWENDUNGS-DEPLOYMENT ==="
|
log "=== ROBUSTES ANWENDUNGS-DEPLOYMENT ==="
|
||||||
|
|
||||||
|
if [ "$GIT_CLONE_MODE" = true ]; then
|
||||||
|
log "📦 GIT-CLONE zu PRODUKTIONS-DEPLOYMENT"
|
||||||
|
log " 📂 Quelle: $SOURCE_BACKEND_DIR"
|
||||||
|
log " 🎯 Ziel: $APP_DIR"
|
||||||
|
|
||||||
|
# Prüfe ob wir bereits im Zielverzeichnis sind (Schutz vor Selbst-Überschreibung)
|
||||||
|
if [[ "$SOURCE_BACKEND_DIR" == "$APP_DIR"* ]]; then
|
||||||
|
log "✅ Bereits im Produktions-Verzeichnis - überspringe Deployment"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
log "🏠 PRODUKTIONS-VERZEICHNIS-UPDATE"
|
||||||
|
fi
|
||||||
|
|
||||||
progress "Erstelle sicheres Zielverzeichnis: $APP_DIR"
|
progress "Erstelle sicheres Zielverzeichnis: $APP_DIR"
|
||||||
mkdir -p "$APP_DIR" || error "Konnte Zielverzeichnis nicht erstellen"
|
mkdir -p "$APP_DIR" || error "Konnte Zielverzeichnis nicht erstellen"
|
||||||
|
|
||||||
# Validiere Source-Verzeichnis
|
# Validiere Source-Verzeichnis (angepasst für Git-Clone-Modus)
|
||||||
progress "Validiere Source-Dateien..."
|
progress "Validiere Source-Dateien..."
|
||||||
if [ ! -f "$CURRENT_DIR/app.py" ]; then
|
local source_app_py="$SOURCE_BACKEND_DIR/app.py"
|
||||||
error "Kritische Datei nicht gefunden: $CURRENT_DIR/app.py"
|
local source_requirements="$SOURCE_BACKEND_DIR/requirements.txt"
|
||||||
|
|
||||||
|
if [ ! -f "$source_app_py" ]; then
|
||||||
|
error "Kritische Datei nicht gefunden: $source_app_py"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$CURRENT_DIR/requirements.txt" ]; then
|
if [ ! -f "$source_requirements" ]; then
|
||||||
error "Kritische Datei nicht gefunden: $CURRENT_DIR/requirements.txt"
|
error "Kritische Datei nicht gefunden: $source_requirements"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
progress "Kopiere Anwendungsdateien (robust)..."
|
progress "Kopiere Anwendungsdateien (Git-Clone-bewusst)..."
|
||||||
|
|
||||||
# Kritische Dateien zuerst (mit Validierung)
|
# Kritische Backend-Dateien zuerst (mit Validierung)
|
||||||
local critical_files=(
|
local critical_files=(
|
||||||
"app.py"
|
"app.py"
|
||||||
"models.py"
|
"models.py"
|
||||||
"requirements.txt"
|
"requirements.txt"
|
||||||
|
"setup.sh"
|
||||||
)
|
)
|
||||||
|
|
||||||
for file in "${critical_files[@]}"; do
|
for file in "${critical_files[@]}"; do
|
||||||
if [ -f "$CURRENT_DIR/$file" ]; then
|
local source_file="$SOURCE_BACKEND_DIR/$file"
|
||||||
|
if [ -f "$source_file" ]; then
|
||||||
progress "Kopiere kritische Datei: $file"
|
progress "Kopiere kritische Datei: $file"
|
||||||
if cp "$CURRENT_DIR/$file" "$APP_DIR/" 2>/dev/null; then
|
if cp "$source_file" "$APP_DIR/" 2>/dev/null; then
|
||||||
success "✅ $file erfolgreich kopiert"
|
success "✅ $file erfolgreich kopiert"
|
||||||
else
|
else
|
||||||
error "❌ Fehler beim Kopieren der kritischen Datei: $file"
|
error "❌ Fehler beim Kopieren der kritischen Datei: $file"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
error "❌ Kritische Datei fehlt: $file"
|
error "❌ Kritische Datei fehlt: $source_file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Verzeichnisse mit robuster Behandlung
|
# Backend-Verzeichnisse mit robuster Behandlung
|
||||||
local directories=(
|
local directories=(
|
||||||
"blueprints"
|
"blueprints"
|
||||||
"config"
|
"config"
|
||||||
@@ -3293,22 +3347,25 @@ deploy_application() {
|
|||||||
"utils"
|
"utils"
|
||||||
"logs"
|
"logs"
|
||||||
"certs"
|
"certs"
|
||||||
|
"systemd"
|
||||||
|
"scripts"
|
||||||
)
|
)
|
||||||
|
|
||||||
for dir in "${directories[@]}"; do
|
for dir in "${directories[@]}"; do
|
||||||
if [ -d "$CURRENT_DIR/$dir" ]; then
|
local source_dir="$SOURCE_BACKEND_DIR/$dir"
|
||||||
progress "Kopiere Verzeichnis: $dir"
|
if [ -d "$source_dir" ]; then
|
||||||
if cp -r "$CURRENT_DIR/$dir" "$APP_DIR/" 2>/dev/null; then
|
progress "Kopiere Backend-Verzeichnis: $dir"
|
||||||
|
if cp -r "$source_dir" "$APP_DIR/" 2>/dev/null; then
|
||||||
success "✅ $dir erfolgreich kopiert"
|
success "✅ $dir erfolgreich kopiert"
|
||||||
else
|
else
|
||||||
warning "⚠️ Fehler beim Kopieren von $dir (möglicherweise nicht kritisch)"
|
warning "⚠️ Fehler beim Kopieren von $dir (möglicherweise nicht kritisch)"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
info "Verzeichnis nicht vorhanden: $dir"
|
info "Backend-Verzeichnis nicht vorhanden: $source_dir"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Optionale Dateien
|
# Optionale Backend-Dateien
|
||||||
local optional_files=(
|
local optional_files=(
|
||||||
"package.json"
|
"package.json"
|
||||||
"package-lock.json"
|
"package-lock.json"
|
||||||
@@ -3316,15 +3373,44 @@ deploy_application() {
|
|||||||
"postcss.config.js"
|
"postcss.config.js"
|
||||||
"README.md"
|
"README.md"
|
||||||
".gitignore"
|
".gitignore"
|
||||||
|
"requirements_clean.txt"
|
||||||
|
"fix_ssl_raspberry.sh"
|
||||||
|
"COMMON_ERRORS.md"
|
||||||
|
"RASPBERRY_PI_SSL_FIX.md"
|
||||||
)
|
)
|
||||||
|
|
||||||
for file in "${optional_files[@]}"; do
|
for file in "${optional_files[@]}"; do
|
||||||
if [ -f "$CURRENT_DIR/$file" ]; then
|
local source_file="$SOURCE_BACKEND_DIR/$file"
|
||||||
progress "Kopiere optionale Datei: $file"
|
if [ -f "$source_file" ]; then
|
||||||
cp "$CURRENT_DIR/$file" "$APP_DIR/" 2>/dev/null || warning "⚠️ Kopieren von $file fehlgeschlagen"
|
progress "Kopiere optionale Backend-Datei: $file"
|
||||||
|
cp "$source_file" "$APP_DIR/" 2>/dev/null || warning "⚠️ Kopieren von $file fehlgeschlagen"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Git-Clone-Modus: Kopiere auch wichtige Root-Projekt-Dateien
|
||||||
|
if [ "$GIT_CLONE_MODE" = true ]; then
|
||||||
|
progress "Kopiere Projekt-Root-Dateien..."
|
||||||
|
|
||||||
|
local root_files=(
|
||||||
|
"README.md"
|
||||||
|
"CLAUDE.md"
|
||||||
|
)
|
||||||
|
|
||||||
|
for file in "${root_files[@]}"; do
|
||||||
|
local source_file="$PROJECT_ROOT_DIR/$file"
|
||||||
|
if [ -f "$source_file" ]; then
|
||||||
|
progress "Kopiere Root-Datei: $file"
|
||||||
|
cp "$source_file" "$APP_DIR/" 2>/dev/null || warning "⚠️ Kopieren von Root-$file fehlgeschlagen"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Dokumentationsverzeichnis falls vorhanden
|
||||||
|
if [ -d "$PROJECT_ROOT_DIR/docs" ]; then
|
||||||
|
progress "Kopiere Dokumentation..."
|
||||||
|
cp -r "$PROJECT_ROOT_DIR/docs" "$APP_DIR/" 2>/dev/null || warning "⚠️ Kopieren der Dokumentation fehlgeschlagen"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Erstelle alle notwendigen Verzeichnisse mit korrekter Struktur
|
# Erstelle alle notwendigen Verzeichnisse mit korrekter Struktur
|
||||||
progress "Erstelle Verzeichnisstruktur..."
|
progress "Erstelle Verzeichnisstruktur..."
|
||||||
local required_dirs=(
|
local required_dirs=(
|
||||||
|
Reference in New Issue
Block a user