@echo off setlocal echo Building mcp-memory (server and stub) for Windows... rustup run stable cargo build --release if %ERRORLEVEL% NEQ 0 ( echo Windows build failed! exit /b %ERRORLEVEL% ) echo Building mcp-memory (server and stub) for Linux (WSL)... rustup run stable cargo zigbuild --release --target x86_64-unknown-linux-musl if %ERRORLEVEL% NEQ 0 ( echo Linux build failed! exit /b %ERRORLEVEL% ) echo. echo Build successful! Gracefully shutting down running servers... :: Attempt shutdown via CLI flag if exist "C:\Users\reazul.ashraf\.local\bin\mcp-memory-server.exe" ( "C:\Users\reazul.ashraf\.local\bin\mcp-memory-server.exe" --exit >nul 2>&1 ) :: Fallback shutdown via HTTP endpoint curl -X POST http://127.0.0.1:3000/shutdown -s -o nul >nul 2>&1 :: Give the server a moment to flush checkpoints and release file locks timeout /t 2 /nobreak >nul echo. echo Copying Windows executables... copy /Y target\release\mcp-memory-server.exe "C:\Users\reazul.ashraf\.local\bin\mcp-memory-server.exe" copy /Y target\release\mcp-memory-stub.exe "C:\Users\reazul.ashraf\.local\bin\mcp-memory-stub.exe" copy /Y target\x86_64-pc-windows-gnu\release\mcp-memory-win-nvim.exe "C:\Users\reazul.ashraf\.local\bin\mcp-memory-win-nvim.exe" echo Copying Linux executables to WSL... wsl -d Ubuntu -e bash -c "cp /mnt/c/Users/reazul.ashraf/workspace/rust/mcp-memory/target/x86_64-unknown-linux-musl/release/mcp-memory-server /home/riz/.local/bin/mcp-memory-server && chmod +x /home/riz/.local/bin/mcp-memory-server" wsl -d Ubuntu -e bash -c "cp /mnt/c/Users/reazul.ashraf/workspace/rust/mcp-memory/target/x86_64-unknown-linux-musl/release/mcp-memory-stub /home/riz/.local/bin/mcp-memory-stub && chmod +x /home/riz/.local/bin/mcp-memory-stub" wsl -d Ubuntu -e bash -c "cp /mnt/c/Users/reazul.ashraf/workspace/rust/mcp-memory/target/x86_64-unknown-linux-musl/release/mcp-memory-linux-nvim /home/riz/.local/bin/mcp-memory-linux-nvim && chmod +x /home/riz/.local/bin/mcp-memory-linux-nvim" echo Copying instructions.md... copy /Y instructions.md "C:\Users\reazul.ashraf\.gemini\antigravity-cli\mcp\memory\instructions.md" wsl -d Ubuntu -e bash -c "mkdir -p /home/riz/.gemini/antigravity-cli/mcp/memory && cp /mnt/c/Users/reazul.ashraf/workspace/rust/mcp-memory/instructions.md /home/riz/.gemini/antigravity-cli/mcp/memory/instructions.md" echo. echo Build and deployment complete! endlocal