Newer
Older
cactus / run-shell.bat
@agalyaramadoss agalyaramadoss on 16 Feb 1 KB added document
@echo off
REM CubeShell Launcher for Windows

echo ═══════════════════════════════════════════════════════════
echo    CubeShell v2.0.0 - Distributed Database Shell
echo ═══════════════════════════════════════════════════════════
echo.

REM Check Java
java -version >nul 2>&1
if errorlevel 1 (
    echo ERROR: Java not found. Please install Java 21+
    exit /b 1
)

REM Check Maven
mvn --version >nul 2>&1
if errorlevel 1 (
    echo ERROR: Maven not found. Please install Maven 3.6+
    exit /b 1
)

REM Parse arguments
set HOST=localhost
set PORT=8080

:parse_args
if "%~1"=="" goto end_parse
if "%~1"=="--host" set HOST=%~2& shift& shift& goto parse_args
if "%~1"=="-h" set HOST=%~2& shift& shift& goto parse_args
if "%~1"=="--port" set PORT=%~2& shift& shift& goto parse_args
if "%~1"=="-p" set PORT=%~2& shift& shift& goto parse_args
shift
goto parse_args
:end_parse

echo Connecting to: %HOST%:%PORT%
echo.

REM Compile if needed
if not exist "target\classes\com\cube\shell\CubeShell.class" (
    echo Compiling project...
    call mvn compile -q
    if errorlevel 1 (
        echo ERROR: Compilation failed
        exit /b 1
    )
    echo Compilation successful
    echo.
)

REM Run shell
echo Starting CubeShell...
echo.

mvn exec:java ^
    -Dexec.mainClass="com.cube.shell.CubeShell" ^
    -Dexec.args="--host %HOST% --port %PORT%" ^
    -Dexec.cleanupDaemonThreads=false ^
    -q