start-goma.ps1 555 B

12345678910
  1. param([string]$gomaDir=$PWD)
  2. $cmdPath = Join-Path -Path $gomaDir -ChildPath "goma_ctl.py"
  3. Start-Process -FilePath cmd -ArgumentList "/C", "python3", "$cmdPath", "ensure_start"
  4. $timedOut = $false; $waitTime = 0; $waitIncrement = 5; $timeout=120;
  5. Do { sleep $waitIncrement; $timedOut = (($waitTime+=$waitIncrement) -gt $timeout); iex "$gomaDir\gomacc.exe port 2" > $null; } Until(($LASTEXITCODE -eq 0) -or $timedOut)
  6. if ($timedOut) {
  7. write-error 'Timed out waiting for goma to start'; exit 1;
  8. } else {
  9. Write-Output "Successfully started goma!"
  10. }