-
Notifications
You must be signed in to change notification settings - Fork 1
/
OpenDevinStartBackend.ps1
58 lines (50 loc) · 1.87 KB
/
OpenDevinStartBackend.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Write-Host @"
###############################################
# OpenDevin Start Backend #
# #
# Created for Windows 10 and 11 #
# #
# github.com/OpenDevin/OpenDevin #
# #
# github.com/risingsunomi/OpenDevinPowerShell #
###############################################
"@ -ForegroundColor Cyan
$confirmInstall = Read-Host "Proceed? (yes/no)"
if ($confirmInstall -ne "yes") {
Write-Host "!! Installation aborted. Exiting." -ForegroundColor Red
exit
}
Write-Host "`n"
$backendPort = Read-Host "Enter backend port (default: 3000)"
if($null -eq $backendPort -or $backendPort -eq "") {
$backendPort = "3000"
}
Write-Host "Opening OpenDevin environment" -ForegroundColor Green
$envFolder = "opendevin_env"
if (Test-Path $envFolder) {
Set-Location $envFolder
} else {
Write-Host "The $envFolder folder not found. Please run the installation before using this script. Exiting." -ForegroundColor Red
exit
}
Write-Host "Activating the virtual environment" -ForegroundColor Green
.\Scripts\Activate.ps1
$projFolder = "OpenDevin"
if (Test-Path $projFolder) {
Set-Location $projFolder
} else {
Write-Host "The $projFolder folder not found. Please run the installation before using this script. Exiting." -ForegroundColor Red
exit
}
# Check if Docker daemon is running
# backend controller will crash if docker is not running
try {
docker info > $null 2>&1
} catch {
Write-Host "Docker daemon is not running. Please start the Docker daemon or check your Docker installation. Exiting" -ForegroundColor Red
exit
}
# start wsgi backend
Write-Host "Starting OpenDevin backend server" -ForegroundColor Green
poetry run uvicorn opendevin.server.listen:app --port $backendPort
Set-Location $PSScriptRoot