mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-07-27 03:48:29 -06:00
Added NPX Fix for Deployment Edge Cases
This commit is contained in:
@ -87,12 +87,10 @@ switch ($choice) {
|
|||||||
# ---------------------- Server: Create Python Virtual Environment & Prepare Files ----------------------
|
# ---------------------- Server: Create Python Virtual Environment & Prepare Files ----------------------
|
||||||
Run-Step "Create Borealis Virtual Python Environment" {
|
Run-Step "Create Borealis Virtual Python Environment" {
|
||||||
# Create virtual environment if it does not exist
|
# Create virtual environment if it does not exist
|
||||||
Write-Host "Create virtual environment if it does not exist"
|
|
||||||
if (!(Test-Path "$venvFolder\Scripts\Activate")) {
|
if (!(Test-Path "$venvFolder\Scripts\Activate")) {
|
||||||
python -m venv $venvFolder | Out-Null
|
python -m venv $venvFolder | Out-Null
|
||||||
}
|
}
|
||||||
# Copy server data if the Data folder exists
|
# Copy server data if the Data folder exists
|
||||||
Write-Host "Copy server data if the Data folder exists"
|
|
||||||
if (Test-Path $dataSource) {
|
if (Test-Path $dataSource) {
|
||||||
if (Test-Path $dataDestination) {
|
if (Test-Path $dataDestination) {
|
||||||
Remove-Item -Recurse -Force $dataDestination | Out-Null
|
Remove-Item -Recurse -Force $dataDestination | Out-Null
|
||||||
@ -103,24 +101,20 @@ switch ($choice) {
|
|||||||
Write-Host "`r$($symbols.Info) Warning: Data folder not found, skipping copy." -ForegroundColor Yellow
|
Write-Host "`r$($symbols.Info) Warning: Data folder not found, skipping copy." -ForegroundColor Yellow
|
||||||
}
|
}
|
||||||
# React UI Deployment: Create default React app if no deployment folder exists
|
# React UI Deployment: Create default React app if no deployment folder exists
|
||||||
Write-Host "React UI Deployment: Create default React app if no deployment folder exists"
|
|
||||||
if (-not (Test-Path $webUIDestination)) {
|
if (-not (Test-Path $webUIDestination)) {
|
||||||
npx create-react-app $webUIDestination | Out-Null
|
npx --yes create-react-app "$webUIDestination" --verbose | Out-Null
|
||||||
}
|
}
|
||||||
# Copy custom UI if it exists
|
# Copy custom UI if it exists
|
||||||
Write-Host "Copy custom UI if it exists"
|
|
||||||
if (Test-Path $customUIPath) {
|
if (Test-Path $customUIPath) {
|
||||||
Copy-Item -Path "$customUIPath\*" -Destination $webUIDestination -Recurse -Force
|
Copy-Item -Path "$customUIPath\*" -Destination $webUIDestination -Recurse -Force
|
||||||
} else {
|
} else {
|
||||||
Write-Host "`r$($symbols.Info) No custom UI found, using default React app." -ForegroundColor Yellow
|
Write-Host "`r$($symbols.Info) No custom UI found, using default React app." -ForegroundColor Yellow
|
||||||
}
|
}
|
||||||
# Remove any existing React build folders
|
# Remove any existing React build folders
|
||||||
Write-Host "Remove any existing React build folders"
|
|
||||||
if (Test-Path "$webUIDestination\build") {
|
if (Test-Path "$webUIDestination\build") {
|
||||||
Remove-Item -Path "$webUIDestination\build" -Recurse -Force
|
Remove-Item -Path "$webUIDestination\build" -Recurse -Force
|
||||||
}
|
}
|
||||||
# Activate the Python virtual environment
|
# Activate the Python virtual environment
|
||||||
Write-Host "Activate the Python virtual environment"
|
|
||||||
. "$venvFolder\Scripts\Activate"
|
. "$venvFolder\Scripts\Activate"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user