From c6ffdd10f74ad3c81ea08b664e777df7b69c0af6 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 27 Apr 2026 16:36:38 +0200 Subject: [PATCH] feat(update-frontend): enhance environment file handling and add Google AdSense script - Updated the script to prioritize the root environment file for builds, falling back to the frontend environment file if necessary. - Added a Google AdSense script to the frontend HTML for improved monetization capabilities. --- frontend/index.html | 4 ++++ update-frontend.sh | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 0cfff60..7428540 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -32,6 +32,10 @@ + + + diff --git a/update-frontend.sh b/update-frontend.sh index d7e71af..ecaf05e 100755 --- a/update-frontend.sh +++ b/update-frontend.sh @@ -6,6 +6,7 @@ TARGET_DIR="${1:?target dir required}" FRONTEND_DIR="$TARGET_DIR/frontend" CURRENT_LINK="/opt/yourpart" CURRENT_FRONTEND="$CURRENT_LINK/frontend" +CURRENT_ROOT_ENV="$CURRENT_LINK/.env" echo "=== YourPart Frontend Update ===" echo "Ziel: $FRONTEND_DIR" @@ -25,8 +26,12 @@ rm -rf node_modules/.cache/ TEMP_ENV="/tmp/yourpart-frontend-env-$$" -if [ -f "$CURRENT_FRONTEND/.env" ]; then - echo "Nutze bestehende .env-Datei vom Live-System für Build..." +if [ -f "$CURRENT_ROOT_ENV" ]; then + echo "Nutze bestehende .env-Datei vom Live-System (Root) für Build..." + cp "$CURRENT_ROOT_ENV" "$TEMP_ENV" + cp "$TEMP_ENV" .env +elif [ -f "$CURRENT_FRONTEND/.env" ]; then + echo "Nutze bestehende .env-Datei vom Live-System (Frontend) für Build..." cp "$CURRENT_FRONTEND/.env" "$TEMP_ENV" cp "$TEMP_ENV" .env elif [ -f .env.production ]; then @@ -68,4 +73,4 @@ if [ -f "$FRONTEND_DIR/.env" ]; then fi sudo -n chmod -R 755 "$FRONTEND_DIR/dist" -echo "=== Frontend Update abgeschlossen! ===" \ No newline at end of file +echo "=== Frontend Update abgeschlossen! ==="