@echo off
echo 🚀 Gooneral Wheelchair - Quick Deploy Script
echo.

if "%1"=="" (
    echo ❌ Error: Domain name is required
    echo.
    echo Usage Examples:
    echo   deploy.bat yourdomain.com
    echo   deploy.bat yourdomain.com server-ip username
    echo.
    pause
    exit /b 1
)

set DOMAIN=%1
set SERVER_HOST=%2
set SERVER_USER=%3

if "%SERVER_USER%"=="" set SERVER_USER=root

echo 📁 Domain: %DOMAIN%
if not "%SERVER_HOST%"=="" echo 🌐 Server: %SERVER_HOST%

if "%SERVER_HOST%"=="" (
    echo 📦 Creating deployment package...
    powershell -ExecutionPolicy Bypass -File "deploy-now.ps1" -Domain "%DOMAIN%"
) else (
    echo 🚀 Deploying directly to server...
    powershell -ExecutionPolicy Bypass -File "deploy-now.ps1" -Domain "%DOMAIN%" -ServerHost "%SERVER_HOST%" -ServerUser "%SERVER_USER%"
)

echo.
if %ERRORLEVEL% EQU 0 (
    echo ✅ Deployment script completed!
) else (
    echo ❌ Deployment script failed!
)

pause