From 12d3b53fe284772792ed94c150c51a76fd393405 Mon Sep 17 00:00:00 2001 From: overcuriousity Date: Thu, 7 Aug 2025 09:54:59 +0200 Subject: [PATCH] script --- deploy.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/deploy.sh b/deploy.sh index 9579a9a..ba00aa2 100755 --- a/deploy.sh +++ b/deploy.sh @@ -133,8 +133,30 @@ echo "✅ Directory structure created" # Copy built application echo "📋 Copying application files..." -cp -r dist/* "$WEBROOT/" -echo "✅ Application files copied ($(du -sh dist | cut -f1))" +if [ -d "dist" ] && [ "$(ls -A dist)" ]; then + # Use rsync for better copying, or fallback to cp + if command -v rsync &> /dev/null; then + rsync -av --delete dist/ "$WEBROOT/" + echo "✅ Application files copied via rsync ($(du -sh dist | cut -f1))" + else + # More reliable copy method + cp -r dist/. "$WEBROOT/" + echo "✅ Application files copied via cp ($(du -sh dist | cut -f1))" + fi + + # Verify copy was successful + if [ ! -f "$WEBROOT/index.html" ] && [ ! -d "$WEBROOT/server" ]; then + echo "❌ Error: Application files not properly copied" + echo "🔍 Dist contents: $(ls -la dist/)" + echo "🔍 Webroot contents: $(ls -la $WEBROOT/)" + exit 1 + fi +else + echo "❌ Error: dist/ directory is empty or doesn't exist" + echo "🔍 Current directory: $(pwd)" + echo "🔍 Contents: $(ls -la)" + exit 1 +fi # Copy essential data files echo "🗂️ Setting up data files..."