|
| 1 | +# ------------------------------------------------------------ |
| 2 | +# Lava • Launcher (PowerShell) |
| 3 | +# ------------------------------------------------------------ |
| 4 | +# - Creates a local `plugins/` directory |
| 5 | +# - Checks for Docker availability |
| 6 | +# - Starts services via: docker compose up -d |
| 7 | +# ------------------------------------------------------------ |
| 8 | + |
| 9 | +$ErrorActionPreference = 'Stop' |
| 10 | + |
| 11 | +if (-not $PSScriptRoot) { |
| 12 | + $PSScriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path |
| 13 | +} |
| 14 | +Set-Location $PSScriptRoot |
| 15 | + |
| 16 | +Write-Host "▶ Lava Launcher" -ForegroundColor Cyan |
| 17 | +Write-Host "Preparing your environment…" -ForegroundColor DarkGray |
| 18 | +Write-Host |
| 19 | + |
| 20 | +Write-Host "1) Ensure plugins directory" -ForegroundColor White |
| 21 | +New-Item -ItemType Directory -Path (Join-Path $PSScriptRoot 'plugins') -Force | Out-Null |
| 22 | +Write-Host (" ✓ Created/verified: {0}" -f (Join-Path $PSScriptRoot 'plugins')) -ForegroundColor Green |
| 23 | +Write-Host |
| 24 | + |
| 25 | +Write-Host "2) Check Docker availability" -ForegroundColor White |
| 26 | +$docker = Get-Command docker -ErrorAction SilentlyContinue |
| 27 | +if (-not $docker) { |
| 28 | + Write-Host " ✖ Docker not found on PATH." -ForegroundColor Red |
| 29 | + Write-Host " Install Docker: https://docs.docker.com/get-docker/" -ForegroundColor Yellow |
| 30 | + exit 1 |
| 31 | +} |
| 32 | +try { |
| 33 | + $ver = (docker --version) 2>$null |
| 34 | +} catch { $ver = $null } |
| 35 | +if ($ver) { Write-Host " ✓ Docker detected: $ver" -ForegroundColor Green } else { Write-Host " ✓ Docker detected" -ForegroundColor Green } |
| 36 | +Write-Host |
| 37 | + |
| 38 | +Write-Host "3) Start services" -ForegroundColor White |
| 39 | +Write-Host " $ docker compose up -d" -ForegroundColor DarkGray |
| 40 | +try { |
| 41 | + docker compose up -d |
| 42 | +} catch { |
| 43 | + Write-Host "`n ✖ Failed to start services with 'docker compose'." -ForegroundColor Red |
| 44 | + Write-Host " Ensure Docker Desktop is running and try again." -ForegroundColor Yellow |
| 45 | + exit 1 |
| 46 | +} |
| 47 | + |
| 48 | +Write-Host |
| 49 | +Write-Host "✓ Services are starting in the background." -ForegroundColor Green |
| 50 | +Write-Host "Helpful commands:" -ForegroundColor DarkGray |
| 51 | +Write-Host " • View status: docker compose ps" -ForegroundColor Gray |
| 52 | +Write-Host " • Follow logs: docker compose logs -f" -ForegroundColor Gray |
| 53 | +Write-Host " • Stop services: docker compose down" -ForegroundColor Gray |
| 54 | +exit 0 |
0 commit comments