-
Notifications
You must be signed in to change notification settings - Fork 1
/
OpenDevinStartFrontend.ps1
58 lines (52 loc) · 1.86 KB
/
OpenDevinStartFrontend.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 Frontend #
# #
# 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"
$backendHost = Read-Host "Enter the backend host (default: 127.0.0.1)"
if($null -eq $backendHost -or $backendHost -eq "") {
$backendHost = "127.0.0.1"
}
$backendPort = Read-Host "Enter the backend port (default: 3000)"
if($null -eq $backendPort -or $backendPort -eq "") {
$backendPort = "3000"
}
$frontendPort = Read-Host "Enter frontend port (default: 3001)"
if($null -eq $frontendPort -or $frontendPort -eq "") {
$frontendPort = "3001"
}
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
}
$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
}
# Set the environment variables
$env:BACKEND_HOST = $backendHost+":"+$backendPort
$env:FRONTEND_POST = $frontendPort
# Run the command
Write-Host "Starting frontend" -ForegroundColor Green
Set-Location "frontend"
npm run start
Set-Location $PSScriptRoot