mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-09-11 04:38:42 -06:00
Added CLI Arguments for faster server and agent launching during development.
This commit is contained in:
45
.vscode/tasks.json
vendored
45
.vscode/tasks.json
vendored
@@ -20,6 +20,51 @@
|
|||||||
"panel": "shared"
|
"panel": "shared"
|
||||||
},
|
},
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Borealis - Server (Flask)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "powershell.exe",
|
||||||
|
"args": [
|
||||||
|
"-ExecutionPolicy", "Bypass",
|
||||||
|
"-File", "${workspaceFolder}/Borealis.ps1",
|
||||||
|
"-Server", "-Flask"
|
||||||
|
],
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "shared"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Borealis - Server (Vite)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "powershell.exe",
|
||||||
|
"args": [
|
||||||
|
"-ExecutionPolicy", "Bypass",
|
||||||
|
"-File", "${workspaceFolder}/Borealis.ps1",
|
||||||
|
"-Server", "-Vite"
|
||||||
|
],
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "shared"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Borealis - Agent",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "powershell.exe",
|
||||||
|
"args": [
|
||||||
|
"-ExecutionPolicy", "Bypass",
|
||||||
|
"-File", "${workspaceFolder}/Borealis.ps1",
|
||||||
|
"-Agent"
|
||||||
|
],
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "shared"
|
||||||
|
},
|
||||||
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
69
Borealis.ps1
69
Borealis.ps1
@@ -14,6 +14,41 @@
|
|||||||
Usage:
|
Usage:
|
||||||
Set-ExecutionPolicy Unrestricted -Scope Process; .\Borealis.ps1
|
Set-ExecutionPolicy Unrestricted -Scope Process; .\Borealis.ps1
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[switch]$Server,
|
||||||
|
[switch]$Agent,
|
||||||
|
[switch]$Vite,
|
||||||
|
[switch]$Flask,
|
||||||
|
[switch]$Quick
|
||||||
|
)
|
||||||
|
|
||||||
|
# Preselect menu choices from CLI args (optional)
|
||||||
|
$choice = $null
|
||||||
|
$modeChoice = $null
|
||||||
|
|
||||||
|
if ($Server -and $Agent) {
|
||||||
|
Write-Host "Cannot use -Server and -Agent together." -ForegroundColor Red
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Vite -and $Flask) {
|
||||||
|
Write-Host "Cannot combine -Vite and -Flask." -ForegroundColor Red
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Server) {
|
||||||
|
$choice = '1'
|
||||||
|
} elseif ($Agent) {
|
||||||
|
$choice = '2'
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Server) {
|
||||||
|
if ($Vite) { $modeChoice = '3' }
|
||||||
|
elseif ($Flask -and $Quick){ $modeChoice = '2' }
|
||||||
|
elseif ($Flask) { $modeChoice = '1' }
|
||||||
|
}
|
||||||
$host.UI.RawUI.WindowTitle = "Borealis"
|
$host.UI.RawUI.WindowTitle = "Borealis"
|
||||||
Clear-Host
|
Clear-Host
|
||||||
|
|
||||||
@@ -272,25 +307,28 @@ foreach ($tool in @($pythonExe, $nodeExe, $npmCmd, $npxCmd)) {
|
|||||||
$env:PATH = '{0};{1};{2}' -f (Split-Path $pythonExe), (Split-Path $nodeExe), $env:PATH
|
$env:PATH = '{0};{1};{2}' -f (Split-Path $pythonExe), (Split-Path $nodeExe), $env:PATH
|
||||||
|
|
||||||
# ---------------------- Menu Prompt & User Input ----------------------
|
# ---------------------- Menu Prompt & User Input ----------------------
|
||||||
Write-Host " "
|
if (-not $choice) {
|
||||||
Write-Host "Please choose which function you want to launch:"
|
Write-Host " "
|
||||||
Write-Host " 1) Borealis Server" -ForegroundColor DarkGray
|
Write-Host "Please choose which function you want to launch:"
|
||||||
Write-Host " 2) Borealis Agent" -ForegroundColor DarkGray
|
Write-Host " 1) Borealis Server" -ForegroundColor DarkGray
|
||||||
Write-Host " 3) Build Electron App " -NoNewline -ForegroundColor DarkGray
|
Write-Host " 2) Borealis Agent" -ForegroundColor DarkGray
|
||||||
Write-Host "[Experimental]" -ForegroundColor Red
|
Write-Host " 3) Build Electron App " -NoNewline -ForegroundColor DarkGray
|
||||||
Write-Host " 4) Package Self-Contained EXE of Server or Agent " -NoNewline -ForegroundColor DarkGray
|
Write-Host "[Experimental]" -ForegroundColor Red
|
||||||
Write-Host "[Experimental]" -ForegroundColor Red
|
Write-Host " 4) Package Self-Contained EXE of Server or Agent " -NoNewline -ForegroundColor DarkGray
|
||||||
Write-Host " 5) Update Borealis " -NoNewLine -ForegroundColor DarkGray
|
Write-Host "[Experimental]" -ForegroundColor Red
|
||||||
Write-Host "[Requires Re-Build]" -ForegroundColor Red
|
Write-Host " 5) Update Borealis " -NoNewLine -ForegroundColor DarkGray
|
||||||
Write-Host " 6) Perform AutoHotKey Automation Testing " -NoNewline -ForegroundColor DarkGray
|
Write-Host "[Requires Re-Build]" -ForegroundColor Red
|
||||||
Write-Host "[Experimental - Dev Testing]" -ForegroundColor Red
|
Write-Host " 6) Perform AutoHotKey Automation Testing " -NoNewline -ForegroundColor DarkGray
|
||||||
Write-Host "Type a number and press " -NoNewLine
|
Write-Host "[Experimental - Dev Testing]" -ForegroundColor Red
|
||||||
Write-Host "<ENTER>" -ForegroundColor DarkCyan
|
Write-Host "Type a number and press " -NoNewLine
|
||||||
$choice = Read-Host
|
Write-Host "<ENTER>" -ForegroundColor DarkCyan
|
||||||
|
$choice = Read-Host
|
||||||
|
}
|
||||||
switch ($choice) {
|
switch ($choice) {
|
||||||
|
|
||||||
"1" {
|
"1" {
|
||||||
$host.UI.RawUI.WindowTitle = "Borealis Server"
|
$host.UI.RawUI.WindowTitle = "Borealis Server"
|
||||||
|
if (-not $modeChoice) {
|
||||||
Write-Host " "
|
Write-Host " "
|
||||||
Write-Host "Configure Borealis Server Mode:" -ForegroundColor DarkYellow
|
Write-Host "Configure Borealis Server Mode:" -ForegroundColor DarkYellow
|
||||||
Write-Host " 1) Build & Launch > " -NoNewLine -ForegroundColor DarkGray
|
Write-Host " 1) Build & Launch > " -NoNewLine -ForegroundColor DarkGray
|
||||||
@@ -304,6 +342,7 @@ switch ($choice) {
|
|||||||
Write-Host "Vite Dev Server @ " -NoNewLine
|
Write-Host "Vite Dev Server @ " -NoNewLine
|
||||||
Write-Host "http://localhost:5173" -ForegroundColor DarkCyan
|
Write-Host "http://localhost:5173" -ForegroundColor DarkCyan
|
||||||
$modeChoice = Read-Host "Enter choice [1/2/3]"
|
$modeChoice = Read-Host "Enter choice [1/2/3]"
|
||||||
|
}
|
||||||
|
|
||||||
switch ($modeChoice) {
|
switch ($modeChoice) {
|
||||||
"1" { $borealis_operation_mode = "production" }
|
"1" { $borealis_operation_mode = "production" }
|
||||||
|
Reference in New Issue
Block a user